Functional Go Programming Language
github.com
github.com
So funcgo is really just Lisp without parentheses... again.
Nested function calls in Java have more punctuation than nested calls in Lisp, and the Lisp ones are generally better indented and thus more readable. It doesn't help that even after 10 years, Eclipse indentation is still absolute crap (aligning method arguments, anyone?), while Emacs got it right back in 2000 (or way before).
I also considered "Clogure", but someone already had that too.
Keep the suggestions coming!
So maybe a good name would be replacing the "c" with "g": Glojure. Doesn't seem to be taken by any other project, and it has the potential for some nice "glow" logos.
I'd love to see a scripting language with go's type system (and concise syntax for declaration, type inference and built in collections) but support for operator overloading and the ability to link in external shared libraries. Basically I want python+numpy (ie external C/fortran numerical code wrapped with pretty operator overloading and a repl) but with go style syntax and pointers.
I'd like it if it also made it easy to tap into C++. It's probably a very complicated problem, which is why it's unsolved.
I'm new to the clojure ecosystem but it looks like https://github.com/mikera/core.matrix could be worth trying.
This project in particular gives some of the benefits of Clojure (JVM, expressive language, immutability), but I don't see any easy way to add new constructs to the language like macros without modifying the compiler itself. Can you modify the grammar that is fed to Instaparse at runtime?
That being said, the current branding and name confused me initially. I was expecting a full Go to Clojure compiler, but it appears that this is mainly a language that has similar syntax to Go which compiles to Clojure, which is still very cool, just different.
Thanks for the feedback on the impression the name and branding gave. I'll try to change the main pages to make clear that Funcgo is not full Go, and is a fairly thin layer on top of Clojure.
The Clojure "syntax" is best for writing macros, whereas the Funcgo syntax is best for writing, and later easily reading, other code. There's nothing wrong with writing code in two languages, one at a higher level up the abstraction stack than the other.
I tried putting such a C/C++/Java/C#/JS/Scala/Groovy/Go/etc-like syntax atop Clojure last year (called "Grojure"). After many iterations, I found each iteration became thinner and thinner, and the functionality more and more aligned with Clojure's. I didn't publish my last attempt because it had evolved into a much simpler 3-step application:
1. lex the tokens, which had different syntax to their equivalents in Clojure
2. define the prefix and infix operators, in their precedence hierarchy, including syntax for function calls
3. define the syntax for the statements, which mapped almost directly to macros which did the processing
The macro linking all three steps together fed the output from step 3 into step 1 to enable interpolated strings. The operators in effect were defined by an enveloping statement, and could be changed in the syntax. If I'd tried another iteration of Grojure, I would have probably merged that step into the 3rd, and used your incanter/infix macro to process them, reducing it all to two steps. And perhaps some of the lexing of step 1 could have been replaced by the Clojure 1.4 tagged elements.
Despite going through all this, I'm still left with a sense of how unnatural it is to read S-expressions whenever I see Clojure or Lisp code, and think the two syntaxes idea (lisp for macros, C/Go for the rest) could be the solution.
But there was one possible snag specific to my/your situation I came across. Grojure, like FuncGo, is atop 2 or 3 other languages:
* Grojure/FuncGo sits atop...
* Clojure, which sits atop...
* Java/the JVM, which is written in, and using JNI can call software written in, ...
* C and/or C++.
I had the idea of only enabling my equivalent of FuncGo to access one layer only below. So one would need to use Clojure to write not only the macros, but also functions to wrap all Java/JVM functionality required at the Grojure/FuncGo layer. I never got around to implementing that because in the end I decided 3 layers was a layer too many. Hope you work your way around this issue.
Interesting idea to use macros to implement the mapping from the Go syntax tree. Presumably, these macros would implement the same kind of logic that my codegen module implements (mapping from the Go syntax tree to Clojure text). https://github.com/eobrain/funcgo/blob/master/src/funcgo/cod...
Basically: Custom language -> some intermediary form which would probably end up having some restrictions on language design -> to the thing you want it to run on.
But it sounds like you're implying another level of abstraction / interface that would be shared between the CLR and JVM etc.
Clojure is specifically designed to be "hosted" on another programming language. Also, it has facilities that let you create your own control structures and otherwise make it easy to create a DSL. (Domain Specific Language)
This basically gives you: Custom language -> some intermediary form which would probably end up having some restrictions on language design -> to the thing you want it to run on.
Scala has been ported to javascript so I think that basically implies most of the languages targeting the JVM could also be.
I have not yet figured out the best way to do something equivalent when targeting the JVM.
This is one of several toolchain issues. In addition to stabilizing the language itself, getting a smooth toolchain is the biggest thing left to do before a 1.0 release of Funcgo.
(Though it is worth noting that Coffeescript, an analogous language, got widespread adoption before tackling the source location issue.)
Personall I rather use a proper multi-paradigm language instead of bandaid tools.
Congratualtions on the work, though.
gofunc yourself