News for hackers. Stuff that matters.
Re:Byte Magazine: LISP (1979) by PaulHoule on Friday August 05, 2022 @09:20PM (#32363875)
There is this project

https://github.com/paulhoule/ferocity/

which I might finish up when I'm done with the report I'm writing. It is possible to create Java expression trees with trees of static method calls that look a lot like S-expressions and stick them together into statements, methods and classes.

You should be able to do the same tricks people do with LISP macros and it could work code generation miracles but it would have that "LISP curse" problem in spades.

The plan is to generate a code generator that is sufficient to generate the full DSL implementation (ferocity0) and use that to generate the full implementation (ferocity.)

I have some tests for ferocity0 writing .java files to get fed to javac and for ferocity0 running expression trees with a primitive interpreter. Already the type system is enriched over the type system because interpreted ferocity0 can handle Java expressions as a type at run time so you get issues like quoting and unquoting in LISP.

Re:Byte Magazine: LISP (1979) by zelphirkalt on Saturday August 06, 2022 @03:47AM (#32365940)
How does this compare to Common Lisp or Scheme macros in in terms of amount of code needed to generate things? How does it compare in terms of what kind of functions and instructions are used? Can one use standard Java language to use it? Could one for example throw a for loop in there or directly write something like "class Point { ..."?