Hacker News new | past | comments | ask | show | jobs | submit login
XXL: A minimal vector programming language (2016) (github.com/tlack)
82 points by kick on Dec 27, 2019 | hide | past | favorite | 19 comments



Author here! Sadly the implementation is pretty slow and very memory leaky but I still like a lot of the ideas that XXL explored. I hope to have some kind of spontaneous mental breakthrough in the future and jump back into it.

Previously on HN: https://news.ycombinator.com/item?id=11379461

Also, kick - enjoying your vector language submissions on HN lately, keep it up


I'm glad to hear you're enjoying them! Thanks for writing XXL; I've found it really thought-provoking!


Are you the sole person working on this? How much time have you out into it and what's the hardest thing you've bumped into?


I've been thinking about making a language since 2004 or so but never actually made a serious attempt. I worked on XXL by myself for about four months with the support of my employer. I'm kind of an idiot so I had to learn a lot of stuff to make any progress at all.

The hardest part was figuring out how the execution mechanism would work - what exactly happens when code is evaluated, etc. There is obviously tons of prior art to look at from other languages but I wanted to take my own more minimal approach to the problem and not design an entire virtual machine with bytecode, etc.


Thanks for taking the time to answer!

Which resources would you recommend for someone who's learning about building a pgoramming language?


This is a really silly question, but what font/theme are you using in the first json example screenshot in the GitHub readme? I love it!


For anyone else that ends up seeing this, the font is Source Code Pro and theme is Lucius.


I think it was Consolas and the Lucius vim theme.


It's futura or a Futura clone.


From the Readme I don't see what's "vector" about this language.


"No stinkin loops" -> would more appropriately be named minimal array PL


XXL is array oriented. All values are arrays, even what are usually considered scalar values. Verbs decide how they should behave with single item array arguments. Verbs like the math functions automatically apply themselves to the entire array. This removes a lot of need for looping constructs, which are discouraged in XXL. Some examples:

    3,6,9 * 3
    (9,18,27)
    3 * 3
    9
Let me know if this makes sense so I can update the readme correspondingly.


This is cool, thanks! Yes, I think the Readme could do with more smaller examples early on.


Minor nitpick, but I really wish the code in the screenshot had more newlines in it.


That's true. It's off-putting and looks ugly to most people.

One of the quirky things about the vector language community is that many of us like to write "wide" code that uses the whole line. The goal is to have as much of the program visible on-screen at one time as possible so you can minimize scrolling around, having to open other files, etc.

I was skeptical at first but I came to like coding in that way. I noticed that when I have to pull up that library's source to look at how something works I sorta lose track of what I was doing and that's how bugs happen.

Of course that example code isn't really a shining example of the practice and should be reworked. Tutorial stuff shouldn't feel dense. Thank you for the feedback.


Yes, especially since the description says "only 6 lines!" yet it's clearly more than 6 lines.


In my humble defense, the latter half of that example (from "'test is { ... }") is the "JSON" encoder being tested / used! But this example could definitely use some work if its going to be featured prominently.


I really don't understand the examples. Would be great if the readme could start with some easy examples and build on them (rather than starting with a parser).


Even worse - it's an encoder, not a parser. I really need to rethink these docs and basically start from scratch. What programming language docs do you really like?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: