Hacker News new | comments | show | ask | jobs | submit login
Spry Language (sprylang.org)
135 points by nickpsecurity 10 months ago | hide | past | web | favorite | 39 comments

This language draws on traits of LISP, Rebol, Smalltalk, and Forth. There's a lot of potential for languages doing that. :) It has a REPL. It’s key components started at under a thousand lines of code each. It was written in Nim, leverages it for GC + concurrency, and can use either Nim or C for performance reasons. I was strongly considering writing a LISP or Smalltalk variant in Nim for past few months for similar reasons. The output would be very different since I want to leverage various analyses for safety-critical tooling. The common thinking seems to have been Nim as a strong, base language for macros, portability, and performance. As in Spry, one also needs something to drop down to when new language isn’t cutting it for whatever reason.

I put it on the Bootstrapping page since I think it has potential to be used or inspire thinking about mid-level languages in that.


All sorts of fascinating stuff linked from there! Thank you for this!

> QEMU actually started as an offshoot of tcc. When fabrice looked into providing multiple output formats for tcc (to support targets other than 32-bit x86), he started playing with multiple input formats as well, such as pages of existing machine code. The result was qemu, which is actually a "dynamic recompiler" rather than an emulator.



FWIW no elements except the menu seems clicable on that bootstrapping page (FF mobile).

You're right: mobile version doesnt work any more. I tested it on Chrome, too. Ill tell the maintainer. Btw, there's a desktop link on bottom that gives working set of links for me. Try that if you see it in FF.

Well, that list of languages got me interested. It'll be interesting to see where you're going with this. I think I'll check out the source a bit. I've been itching to hack on another GC for a while now.


The Show was a moderation error. It was just a submit. The list of languages got me interested, too, in whatever the author is doing. I posted it partly so people would see that list to hopefully get their own ideas. I imagine most tweaks of those languages would be of limited utility for large audiences much like most tweaks of LISP or OOP themselves. Yet, there might be some combination of features that's pretty amazing waiting to be discovered.

I mentioned what I liked in the past with what metrics I wanted optimized in the future here:


The Brute-Force Assurance concept I've described scattered in different places to get most benefits of strong verification without cost and time drawbacks of needing specialists. I [probably] got idea from a mix of VMS or CLR's mixed-language development plus SRI attempt to convert proofs to every form to use their tooling. My concept was coding in language w/ metaprogramming and Design-by-Contract that can be converted into equivalent Rust, C, SPARK, and so on. Languages with lots of push-button-style tooling for finding or proving absence of defects. They all run on the code with anything found shown to developer to see if it's in original code. Rinse repeat until nothing found. If extracting to C, one can also use CompCert or Simpl/C for certified compilation with CPU's like CHERI optionally enforcing safety/security at machine level. Similar concept on spec side where structural and temporal properties might output a bunch of stuff like Alloy, TLA+, SPIN, Why3, or whatever to run against all of it at once.

With it being a HLL w/ metaprogramming, it might allow a development cycle with quick iterations, REPL coding, whatever. At some point, each component is semi-frozen where developer starts annotating it to fire off the verification processes in the background as he or she works on the next component. Quickest analyses run first instantly reporting results so code is still fresh in mind. The app can follow gradual assurance philosophy similar to gradual typing with a mix of stuff in motion that's at least memory/concurrency/interaction-safe with dynamic checks covering what static ones can't plus things with tons of verification.

At least, that's what's been tumbling around in my head for a while on this topic. There's a few works out there right now suggesting it might be more doable now than ever before. It would take some funding, some language lawyers, and people with knowledge of implementing such tooling.

Pretty cool to see Nim being stable enough prior to 1.0 for people to be writing other languages with it.

Spry does look pretty cool too. Besides JS, I have huge respect for all the langs that Spry was influenced by (Lisp, Rebol, Forth, & Smalltalk). I think only APL is left out if this were my favorite grouping :).

With that being said, what are the plans for doing a multi-user live coding setup? Also, how is the Smalltalk like syntax homoiconic?

The multiuser stuff etc, I am temporarily too focused on other things so Spry is at "a hold" right now. I would also like to fix more things in the language before proceeding.

The Smalltalk keyword syntax is a simple preprocessing in the parser so that `a at: 3 put: 5` turns into the AST of `a at:put: 3 5`. And yes, it's homoiconic.

Sometimes, when I read that a language was inspired by another language, I wonder why you can't see the simplicity of the first in the second.

People said that about Wirth's languages, too. Yet, metaprogramming, highly-optimizing compilers, REPL's, generics, concurrency models that were safe, Design-by-Contract, and so on all had their benefits that complicated implementation. In my opinion, some features like those were worth complicating implementations of languages since they simplified developers' work on every other project in that language. So, I'm always up for looking at new languages in case their experiments can teach us to do something better. Maybe it will simplify, complicate, or just refactor something in process. I don't care long as end result is better in a measurable way.

So, I'm as cautious about attempts to over-simplify things as I am to over-complicate them. Well, ok, I worry about over-complicating things more if it's programming we're talking about. I do try not to forget the other in the rare cases I think it might show up. ;)

Looking at my inspirations I would (take it with a grain of salt) say that Lisp and Forth are too simple, javascript is a mess (but with nice literal syntax for maps etc), Smalltalk is too complicated and Rebol is basically also a bit complicated and IMHO a bit of an oddball with some neat ideas. And Nim is a totally different beast.

I thought Smalltalk was relatively simple. What makes you think it's too complicated?

I have worked extensively with Smalltalk, I know it quite well and it's my favorite language. I made SqueakMap and several other packages for Squeak. Still, it's not as simple as it can/could be, especially not the meta model. Alan Kay himself has the same feelings AFAIK.

Do you have anything specific in mind about how you'd simplify it while keeping the overall experience? That's what I meant by the question.

Far as Kay, he's been building things on LISP's and Ometa-like languages in STEPS that I was aware. Given that, Im not sure how much he really believes im Smalltalk these days. Maybe he's implemented new Smalltalks that I just missed.

Second-system effect?

This is impressive enough that it might turn into a real language instead of a hobby language. I think improving the speed is the top concern. Everything else seems to be already in place.

How could they do that without doing something like LuaJIT?

The general idea was to leverage Nim's capabilities, either as implementing core parts of standard libraries in Nim (which is very easy to do) or possibly by partial compilation using the Nim meta programming mechanisms.

Am I the only one who thought wait a minute. Is Adobe's JavaScript framework making a comeback?

Jeez I’m starting to feel old now, yes the name sounded familiar to me

For those who were wondering like I was:


Has anyone else completely lost interest in non-"functional" languages after spending years making the same OO mistakes?

Yes, and then I lost interest in in functional languages after discovering the beauty of imperative programming for predictability and performance. All major programming paradigms can be useful, some are better suited for some problem than others.

Sounds like you just jumped from one bandwagon to another.

I’d wonder that except that I’m finding I’m writing far fewer bugs

Fortunately there is some empirical data becoming available to support this (single data point) assertion:

“Functional languages have a smaller relationship to defects than other language classes such as procedural languages” – A Large Scale Study of Programming Languages and Code Quality in Github

“Functional and scripting languages provide significantly more concise code than procedural and object-oriented languages.” – A Comparative Study of Programming Languages in Rosetta Code

So were is the feature for DRY business logic like centralized validation? There was a post not too long ago about Bitcoin like currency that only validated on the front end. Where is the language or framework that solves this? To this day Java doesn’t. I don’t think that even Node really does.

I guess WebForms if they passed to POCOs that errored in a certain way.

Can you provide the link to the currency you mentioned?

What is the appeal of "100% live coding in a Smalltalk style immersive environment"?

A lot of things including very good development speed, very good debugging capabilities, very good meta programming (making your own tools) etc. Try out Pharo.org for example.

Are you the author of or contributor to Spry?

It is posted as "Show HN" so I would assume so.

No, no, I nust have clicked wrong thing by mistake. I meant it as a regular submission, not show hn. Im not the author. Ill email dang to see if he can change that.

I did think you all would like it, though. Again, sorry for clicking wrong thing everyone. :(

This was completely my fault, I misinterpreted the original comment and added “Show HN”. Removed now. Sorry!

Given my memory problems, I was really stretching to figure out how I did that. I just assumed I slipped since they're close together on this device. So, I appreciate you owning up to it so I dont get all paranoid about submissions haha.

Ah, it all makes sense now, thanks. Clearly we should all be grumplinking you the Show HN rules!

Either they changed their websites or I have memory loss .. I posted this on reddit a year ago but completely forgot that when reading this page

They = me. I suppose you did it when Spry was still called Ni?

I have no recollection of anything, I just wanted to share it to reddit and I realized it was already done long ago 4 times, one of the submissions by myself u_u


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