3 ms·
I made a start on type inference for stack-based languages in the context of Joy, but I kind of wobbled off at the end: https://joypy.osdn.io/notebooks/Types.ht
by carapace 6y ago
I made a start on type inference for stack-based languages in the context of Joy, but I kind of wobbled off at the end: https://joypy.osdn.io/notebooks/Types.html#conclusion https://joypy.osdn.io/notebooks/Types.html#conclusion
It turns out to be easier to work in Prolog.
- sitkack 6y agoThis is really cool! I am so glad you have kept Joy alive. I remember when website reorgs would kick Manfred von Thun's website offline for months to then re-appear and disappear again.
- carapace 6y agoCheers! I'm not sure what made me pick it up, but it's grown on me. FWIW the Prolog version is here: https://git.sr.ht/~sforman/Thun/tree/master/source/thun.pl https://git.sr.ht/~sforman/Thun/tree/master/source/thun.pl There's a bunch of junk in there, like a start on compilers. (I'm just messing around. Recursion is like an end boss that I know the strategy to defeat but I've been too lazy or busy to put in the work to implement it.) Fun fact: in Prolog the interpreter and the type inferencer are the same code! Also, I recently wrote an interpreter in Nim, more-or-less for kicks: https://git.sr.ht/~sforman/Bliss https://git.sr.ht/~sforman/Bliss I have a hunch that concatinative languages are important somehow. Have you seen "Compiling to categories"? http://conal.net/papers/compiling-to-categories/ http://conal.net/papers/compiling-to-categories/ He's converting Haskell into a point-free form (that's very similar to Joy) and then compiling that over various Categories to get several kinds of programs from one expression.