5 ms·
Concatenative language (2017)
- xelxebar 8y agoI just stumbled across this Google Tech Talk on [factor][0] last night! It absolutely blew my mind. The engineering looks to be top notch, and the video is 9 years old to boot! https://www.youtube.com/watch?v=f_0QlhYlS8g https://www.youtube.com/watch?v=f_0QlhYlS8g Anyway, really want to give Factor a try for some personal projects. Would love to hear anecdotes from people who futz with this stuff. [0]:https://factorcode.org https://factorcode.org
- doublec 8y agoI used Factor a lot in the past. It's a great language. Some blog posts of mine on the subject: https://bluishcoder.co.nz/tags/factor/ https://bluishcoder.co.nz/tags/factor/ And here's a quick screencast I put together that shows using the Factor GUI to drill down objects and source using the Gopher client as an example: https://www.youtube.com/watch?v=sozwQ7QmOhs https://www.youtube.com/watch?v=sozwQ7QmOhs
- arethuza 8y agoI worked on a project in the early 90's that was written mostly in PostScript (NeWS) and Common Lisp - two languages that have rather more in common than you might think! Edit: Wasn't so much just PostScript environment but the NeWS/HyperNeWS environment that made that graphical programming rather good fun...
- macintux 8y agoPeople have described Forth as Lisp without the parentheses. Definitely some interesting parallels.
- arethuza 8y agoI toy with the idea occasionally of writing a Lispish language (probably a whitespace lisp) that transforms itself down to a Forth/PostScript style engine for execution - one of many things on my ToDo list ;-)
- kazinator 8y agoStack-based byte code machines for Lisps are not uncommon. Emacs Lisp has one, CLISP too, I think. It keeps the instructions small, since operand references are implicit.
- arethuza 8y agoI was more thinking about a runtime conversion from a Lisp style AST to RPN primitives rather than a more traditional compiling stuff down to a separate VM - but clearly not something I've thought through in that much detail!
- sctb 8y agoYou can have both! https://github.com/sctb/woe/blob/master/boot.w https://github.com/sctb/woe/blob/master/boot.w
- kazinator 8y agoThose people were horribly misinformed.
- macintux 8y agoSure, they're very different languages, but they nonetheless have a lot in common. http://wiki.c2.com/?ForthVsLisp http://wiki.c2.com/?ForthVsLisp is quite an interesting read.
- exikyut 8y agoInteresting. What was the project about?
- arethuza 8y agoIt was an EU ESPRIT 2 project to develop "Intelligent Training Systems" for complex industrial plants. I worked in an academic partner - the team I worked in was mostly control engineers and mathematicians and I was the lone CS guy who got to actually build stuff.
- jonenst 8y agoI had fun participating in the google codejam using factor, and in 2012 I wasn't the only one ! https://www.go-hero.net/jam/12/languages/Factor https://www.go-hero.net/jam/12/languages/Factor Too bad that google codejam limited the available languages starting from 2018.. Factor is a very impressive engineering accomplishment, the standard library has so many useful algorithms and data structures implemented, and almost all of it with very clean APIs and documentation.
- exikyut 8y agoThat website is very broken now sadly, and appears to only have records going up to 2017. I can't find 2018.
- jhoechtl 8y agoInteresting fact: The day Slava Pestov gave his Techtalk, the next door Golang was presented. History might have taken another turn for Factor if Golang didn't slurped the audience on that day.
- slavapestov 8y agoHah! I don't think a stack-based language would have taken off regardless of who was in the room that day, to be honest. It all worked out well anyway, I ended up joining Google a couple of years after that talk, and now I'm at Apple working on Swift. It's not as elegant as Factor but of course has a much bigger user base.
- murbard2 8y agoThe author might want to add K and Q to the list, both widely used in finance and concatenative. https://kx.com/ https://kx.com/ There's also the open source j, in the same fine http://www.jsoftware.com/ http://www.jsoftware.com/ Last but not lest, Michelson, Tezos' smart contract language https://tezos.gitlab.io/master/whitedoc/michelson.html https://tezos.gitlab.io/master/whitedoc/michelson.html (shameless plug) is also a concatenative language.
- klibertp 8y agoAre you sure about that? I don't know K/Q, but I learned some J and I don't think it can be called concatenative. It's tacit/point-free style it but one of the styles you can use in J. I think if J is concatenative, then so is Haskell - and I never heard anyone claiming that.
- murbard2 8y agoI know less about J, but idiomatic K/Q is definitely concatenative. I suppose the emphasis should be on idiomatic.
- klibertp 8y agoOh, ok. I think the point-free J (ie. without any explicitly named variables) can be called concatenative in spirit, too. If you stick to expressions composed of monadic verbs and nouns and squint hard enough, you could say it's concatenative (but with prefix notation). On the other hand, it has these totally crazy rules of composition - called hooks and forks, different for monadic and dyadic verbs - plus adverbs which modify verbs and gerunds, and other things which together make you feel that parsing PERL is sane and straightforward in comparison to reading J. Lots of fun, though, it really feels like you're learning a language some ancient alien civilization left inside pyramids on Mars :)
- thesz 8y agoIn Haskell there is an operator "space" - an application operator, which applies left side to argument on right. It is a source of Haskell conciseness [1]. [1] http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144.411&rep=rep1&type=pdf http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.144... (Is Ours Smaller Than Theirs?) You can have special operators when space is not enough, it is exemplified in applicative style - (<<star>>) has type Applicative f => f (a -> b) -> f a -> f b, e.g. it applies elements from right side argument to a left side argument with functions as elements. (<<star>> is a "< * >" without spaces - HN screws that) In concatenative languages you also have an implicit operator, much like Haskell's "space" or <<star>> above. In fact, you can invent one and use it instead of space of Forth. And that way Haskell will be concatenative too!
- tragomaskhalos 8y agoAlso the Bitcoin script language (as limited as it is)
- cryptonector 8y agojq is kinda concatenative too. It follows the pipeline style, and it does operate on an [implicit] stack.