162 points · by phonebucket · 5y ago · 52 comments
My take on "Lisp in Julia" using deprecated-but-still-parseable syntax instead of a string macro: https://github.com/christopher-dG/jlisp
I should probably put some examples in the readme.
A better example would be Java/Clojure.
The main ones I am aware of are:
JavaScript: you basically got to if you want to run in a browser.
And C Because it's available on every piece of hardware, it was there before llvm and it doesn't change across hardware (unlike assembly), and most people writing languages know C.
JVM, the .Net CLR etc are not languages. They are intermidate representations like LLVM is. (Approximately). They were designed to be compilation targets. Julia wasn't.
Most of Julia's intersting compiler features are unusual because they need to solve problems Julia has in general other languages wouldn't,or that would not transfer across language boundaries.
The macro stuff is awesome for DSLs. Messing with compiler passed is cool for adding capacities. But I think much more in the sense of implementing a micro language that is closely related to Julia, rather than a full on language that has its own goals and identity (I want to write one for codegolf called Jules that is just Julia except on an error it tries some other lexically nearby code)
Running 'julia --lisp' launches a femtolisp (https://github.com/JeffBezanson/femtolisp) interpreter.
https://github.com/JuliaLang/julia/blob/master/src/julia-par...
Jesus H Christ could the whole FP world stop this? You're either going to prioritize static types or you're going to blow them off. Either front-and-center your type system, or stop mentioning how you blew it off. Those of us who want Clojure's syntax and semantics and a decent type system would like to stop being taunted.
When the notes say "optional typing - currently not implemented", all they're saying is that this syntax doesn't allow you to tap into that feature, because a syntax for type declarations has not been provided.
When this gets typing, it will be with Julia’s very powerful and expressive type system (which is dynamic by the way), and it just needs someone to modify the LispSyatax.jl parser to properly represent the type annotations.
Calm down.
If it were not mentioned, the implication would by that it was available.
Is it that the Lisp language exposes the Abstract Syntax Tree (AST) of the code, so that you can reformulate it into your domain-specific macros, thereby helping you encapsulate complex logic into more succinct constructs?
Is this why they say that Lisp is fantastic for small groups of programmers, that share similar groupthink, and uses all the same macros, but it becomes a horrendous mess when multiple teams are involved.
I'd say yes, this, though you don't actually manipulate a proper AST, but a list (tree) of program instructions. An AST would be given by a "code walker". Plus, the syntax is small and coherent, the language is stable, the syntax makes it straightforward to add new language constructs that would need a language release for another classical language. With most implementations of Common Lisp, you code against a live image, so you get instant feedback: compile a function with a keybinding, see compiler warnings or errors instantly, try it right away in the REPL (no process had to restart), get an interactive debugger on an error, fix it and resume the execution from a chosen frame (no stack unbinding), inspect objects, change a class definition and have existing objects being (lazely) updated, given rules in the standard that you can control… when ready, build a binary, and deploy. Today, SBCL's compile-time type-inference warnings are very helpful.
Of course, some companies use CL in a million-sized codebase (if that helps as a counter example): Google (ITA software), SISCOG (underground and rail transport optimisation), ACL2 (industry-strength theorem prover)…
https://lisp-lang.org/success/
https://github.com/azzamsa/awesome-lisp-companies (disclaimer: these resources are not complete)
Others know better the limitations of Lisp systems of the 80s or 90s. The compilers also improved (SBCL; there is CLASP in development to interface with C++ code, and more)
TLDR; it's catching up :D
No, why they say is because they have zero experience with Lisp, in any size project.
And there exists no tool using which some people have not made big, huge mess. We can easily lob this criticism at anything, quite randomly.
Imagine a tool which has the property that a team of doofuses, no matter how large (in head count and doofiness), cannot make any sort of "horrendous mess". What sort of limitations does that entail, and could any of us here live with them?
It would also only take a couple of hundred lines to write a parser for a C compiler that would allow that.
Add all that up, and you're no longer looking at alternative syntax, you're looking at a transpiler.
Particularly Rich... Hickey?