4 ms·
Scheme.forth.jl: Scheme in Forth in Julia
- macintux 7y agoSeems like you could use this to build a chain of platforms for the hell of it. Prolog in Elixir in Python in Scheme...
- all2 7y agoThere's a good start on a list-expression evaluator here: https://norvig.com/lispy.html https://norvig.com/lispy.html I followed that introduction to start hacking on my first compiler (in an interpreted language with no system calls or any concept of variable scoping). I think I got to implementing an AST before I quit. When I do it again I'll be using a different language (probably Gambit/Gerbil if I can find time to learn them). Makes me wonder why python is so much easier for me than Gambit? I think it might just be the sheer volume of SE posts, tutorials, and documentation...
- Someone 7y agoWould be a fun data science project: given the READMEs of all github projects, find the longest chain of programming language implementations without (close) duplicates. Prove that it is a valid chain by actually running all compilers. Bonus points for less common languages such as SNOBOL and Mumps, or languages rarely reimplemented and/or rarely used for writing compilers such as TI-59 or Lotus-123 macro language.
- dnautics 7y agoYou're going to have a hell of a time implementing elixir in python.
- macintux 7y agoIt’d be a lot harder to implement Python in Elixir!
- dnautics 7y agoWould it? The basics of the language are at least easy, you might have trouble when python drops into it's ffi. Same holds in the reverse; you can't easily do elixir ffi in python. FFI aside, I don't see a good way of implementing Kernel.spawn/1, Process.monitor/1, etc. in python, without rebuilding the entire erlang VM from scratch.
- macintux 7y agoIt’s a lot easier to implement an immutable language in a mutable one than vice versa, or so I’d assume, never having tried. But yeah, I’d assume you’d have to build the VM first. A lot of work.
- dnautics 7y agoYou can mock mutable variables in actors. Actors and genservers are a first class module in the standard library. Elixir is not Haskell. There are plenty of places with accessible statefulness/mutability, it's just shielded in a functional wrapper and made slightly difficult to dissuade you from using statefulness unnecessarily, so you make fewer coding and concurrency mistakes in annoying places and you can focus on delivering features and solving hard problems.
- JadeNB 7y agoI sure thought that there was a name, somewhere between quine (https://en.wikipedia.org/wiki/Quine_(computing) https://en.wikipedia.org/wiki/Quine_(computing) ) and polyglot (https://en.wikipedia.org/wiki/Polyglot_(computing) https://en.wikipedia.org/wiki/Polyglot_(computing) ), for this: a program in one language that, when run, outputs a program in another language that etc. I can't find the name or a good example (other than the parent post!), though.
- cultus 7y agoTo really go through the rabbit hole, I wonder if one could then use this as Julia's parser, which itself is written in Femtolisp (a scheme).
- kevinmgranger 7y agoYou'd almost have a quine relay: https://github.com/mame/quine-relay https://github.com/mame/quine-relay
- cultus 7y agoWow, that is impressively insane!
- eigenspace 7y agoI'm loving all these little projects embedding languages in Julia.
- UncleOxidant 7y agoWas gonna try it, but it failed to install the forth.jl package. Then I went and looked at the forth.jl github page and it says: > Be aware that forth.jl requires Julia 1.0 Whereas on the scheme.forth.jl page it said: > (forth.jl requires version >=1.0) At any rate it doesn't install in Julia 1.4.0: > ERROR: could not find project file in package at https://github.com/tgvaughan/forth.jl https://github.com/tgvaughan/forth.jl