4 ms·
Catenary: concatenative programming for JavaScript
- hvm 11y agoThis looks interesting, I feel it has a lot of potential. It will be useful with a standard library or a way to link easily to 'outside' functions without having to create (insert?) them in each cat that uses them.
- Menge 11y agoDefine modifies the prototype, so `cat define 'x' x` should apply to every cat (the docs have an example for making it a local property instead.) I think the larger barrier is that most libraries have functions with optional arguments so you would need to consider how to wrap each one. But I really don't get the "for JavaScript" mentions. Without at least a pre-transpiled script to download and use as you would any JS, it is "for JavaScript" much like it is "for x86-64 assembly."
- eatonphil 11y agoIf you are unfamiliar with concatenative, stack-based languages, I wrote an introductory blog post that might be a little easier to read[0]. I say that only because the chaining style here can feel a little dense. [0] http://blog.eatonphil.com/2015/04/06/introduction-to-stack-based-languages-with-and-elementary-debugging-in-forth/ http://blog.eatonphil.com/2015/04/06/introduction-to-stack-b...
- kriro 11y agoMy first thought was...wait that looks like Forth. And sure enough your post uses Forth. I hadn't heard the term "concatenative programming" before so I guess I learned something new :) Forth is certainly one of the languages that has wooed me (or more precisely it has wooed me what cool ideas were built with it). Pretty much every CCC used to have some nifty hardware+Forth project on display (I remember crazy pendulums)
- eatonphil 11y agoYou might enjoy this thread from the discussion on r/programming[0]. I was lucky enough to ensnare a PL professor. [0] http://www.reddit.com/r/programming/comments/31qitu/introduction_to_stackbased_languages_with_forth/cq4otmv http://www.reddit.com/r/programming/comments/31qitu/introduc...
- MrBuddyCasino 11y agoThe Wikipedia site mentions that today, Forth is used in BootROMs - is that because no heap (=initialized DRAM) is required to run it, so the CPUs onboard memory can be used? I guess you need something for the very early stages, for when the peripherals are not yet available.
- jkleiser 11y agoIf you really want to do some serious concatenative programming, this is probably a useful site: http://www.factorcode.org http://www.factorcode.org
- agumonkey 11y agoWith the mandatory (and wonderful) talk: http://www.youtube.com/watch?v=f_0QlhYlS8g http://www.youtube.com/watch?v=f_0QlhYlS8g
- naturalethic 11y agoLiveScript: take-this |> do-this |> then-do-that