15 ms·
This is cool, but the code is... strange? https://github.com/vygr/ChrysaLisp/blob/master/gui/canvas/tga.vp https://github.com/vygr/ChrysaLisp/blob/master/gui/ca
by smabie 7y ago
This is cool, but the code is... strange? https://github.com/vygr/ChrysaLisp/blob/master/gui/canvas/tga.vp https://github.com/vygr/ChrysaLisp/blob/master/gui/canvas/tg...
The code doesn’t look like Lisp at all. Is this some sort of lower assembler language that Lisp is implemented on top of?
- dasmoth 7y agoSee https://github.com/vygr/ChrysaLisp/blob/master/docs/VM.md https://github.com/vygr/ChrysaLisp/blob/master/docs/VM.md
- pdexter 7y agohttps://github.com/vygr/ChrysaLisp/blob/master/apps/terminal/app.lisp https://github.com/vygr/ChrysaLisp/blob/master/apps/terminal... for example
- vygr 7y agoThat code is using the C-Script assembler prototyping macros. It will produce VP assembler output, but lets you work without worrying about registers while you're getting stuff going. Have a read through the docs/ASSIGNMENT.md file to see how this all fits together.
- capableweb 7y agoLooks like imperative/sequential lisp to me. Got those parenthesis, quoting and some light-weight nesting. Anything in particular that sticks out to? Lack of recursion?
- TheAsprngHacker 7y agoAs someone who isn't familiar with this Lisp dialect / DSL, something that stands out to me is the (def-struct ...) ... (def-struct-end), (def-method ...) ... (def-func-end), (switch) ... (endswitch), and (vpif ...) ... (endif). The appeal of s-expressions is that their nested structure is supposed to delineate the abstract syntax tree of the program, with the opening and closing parentheses denoting the boundaries of a construct. IMO this language's syntax isn't faithful to the spirit of Lisp.
- vygr 7y agoThe (def-struct) stuff is part of the assembler ! Not the Lisp. Same with (def-enum) etc. I am going to have to write a document to clearly state where these boundaries between the Lisp, the C-Script and the VP layers. I realise it's not that obvious sometimes. Chris
- Koshkin 7y ago(def-func-end) and other ‘ends’ look pretty un-lispy to me. Helps readability, though.