Hacker News .hnnew | past | comments | ask | show | jobs | submit | tkrn's commentslogin

Describing Coalton as a CL add-on or even as a DSL has always seemed wrong to me. It's of course very tightly integrated with the Common Lisp runtime but it's also very different as an actual language. And I mean that in a positive way as being different from CL is both an achievement but also a requirement for doing what it does.

I just found it funny how Clojure's lack of cons pairs is enough to cause religious debates about its Lisp nature while (ISTR) adding symbols to Coalton basically requires foreign calls to the host system, but it still counts as a CL-with-types.


Wouldn't that be something that the tooling could deal with easily? I don't know if there is anything like that yet, but the last time I took a quick look at Coalton it seemed like some basic SLIME and ASDF etc support with its own filetype and Emacs mode to go with it could be potentially useful and fun little project.



Nice, pretty much what I had in mind. I think there could be some interesting potential there tooling wise. Combining a highly dynamic interactive environment with a good statically typed language sounds fascinating to me and it's something that at least to my knowledge has never been seriously tried. Only Strongtalk comes to mind but I have no idea how it was like in practice, and I assume the type system was something closer to Java.


SAVE-LISP-AND-DIE is also pretty metal function name. Goes nicely with the shout-case too.


I agree that there is maybe too much potential for confusion with that, but is the dot operator (or read syntax?) actually used that much these days?

Personally I have mostly sometimes used it with Emacs Lisp, but in general relying too much on plain cons cells and cadring down the cars of their cddars feels like a code smell to me and if I need a pair I can always just use cons? As the (only, I think?) infix operator in traditional lisps it has always felt extra-ordinarily useless to me (outside of Schemes use of it lambda lists), but maybe I'm just missing something.


Pairs are used by about 3-quarters of the standard library of Scheme, so I really would not consider its use to be a code smell.

You should be using the pairs when using make-hash, for example.

Cons also doesn't always return a pair. Its main purpose is for prepending to a list. Only when "the second argument is not empty and not itself produced by cons" does it produce a pair.

Which means '(a . b) is clearer code in intent, than (cons a b).


Good points. I don't think pairs are a code smell when used reasonably in situations where a pair of two values makes sense, like in your make-hash example. Ideally though I'd like to have a real, distinct (immutable) pair/association type separate from the cons/list and maybe use the dot syntax for that instead.

Deeply nested pair & list constructs that need to be unpacked with complex car/cdr combinations is what IMHO gets messy and I take the appearance of cddar & co in code as a sign that I should start thinking about using proper data structures.


A distinct and immutable pair is... A pair.

    (eq? (pair? '(A . B)) #t)

    (eq? (pair? (list 1 2 3)) #f)
But agree you probably want list-ref instead of cddr and friends.


I think you need something like it in order to have a print representation of a cons cell whose cdr is not a cons-or-nil. And it's nice if your print representations are readable.


I'm not too fond of adding extra syntax or infix operators to Lisps but I have been thinking lately if maybe some limited form of infix macros could be useful, mainly in binding forms and such. E.g anaphoric ifs were a thing in the past for binding conditional expression's value; currently the preferred method seems to be if-let, or when-let and maybe unless-let too, and of course also the let* variants. And for completeness one might also need cond-let with its own different semantics. Oh, and maybe letrec and a few others too. But at that point it might make sense to come up with some kind of define-let-form macro facility to deal with the general pattern.

But all that gives me a nagging feeling that maybe traditional Lisp macros don't really compose that well? So as a band-aid I had the idea to introduce special infix macros so one could for example do "(if (expr as: var) (something-something var))", or maybe "(something-something var where: var expr)" and so on. I'm not sure what the exact semantics should be though, especially with the as: form. It's probably just a result of doing too much Smalltalk lately, but out of all the "let's fix lisp's syntax" ideas I don't think I have seen exactly this one before, so that's something I guess. (As an alternative we could also of course just replace the lambda form with something less verbose so one could "(if expr [var | something-something var])" and then make the conditionals regular functions, or even generic ones specialized on booleans. Or maybe I'll just get back to hacking my init.el for now and try to cleanse my mind of these impure thoughts.)


SRFI-105 is an infix syntax that composes well, and is supported by most Schemes.

Its enabled by default with Guile, for example.

    (+ 1 2 {10 * 2} 6)
https://srfi.schemers.org/srfi-105/


>The spaghetti code was astounding, and I remember squeezing line numbers between existing code-- adding a "31 GOTO 40" so I could squeeze a "room" into lines 32-39.

I spent too many nights trying to implement complex text adventures in Commodore 64 Basic and I'm sure that instead of permanently damaging me (at least in the sense that Dijkstra meant) it just made me appreciate more all the abstractions later languages introduced to me.


I could see LLMs being useful as just an UI layer on top of traditional interactive fiction engines? Having a voice-operated IF assistant/narrator paired with tools for note taking and such could offer an accessible alternative interface to the large existing IF library (or maybe something like that exists already?).

Taken further the assistant's role could be expanded with greater autonomy. Games could include metadata and authors hints & directives for the narrator. Or a limited interface for manipulating the game state and shifting the traditional IF model closer to a two player collaborative game. Using the LLM to transform and extend pre-authored text might actually offer new narrative possibilities, assuming the model could do it subtly and well enough, the style, POV, mood an so on of prewritten content could be freely modified in some interesting ways. E.g introduce unreliable narrators, describe the player's actions from a point of a security camera or their dog, rewind and replay events from some other characters POV. Simulate psychological issues by subtly rewriting the player's (or the narrator's or NPCs) perception of the world and have them navigate a little twisty maze of emotional states, all different.

Restricting the model into operating strictly within the limits of human authored content could bypass some of the usual problems associated with purely AI generated games and the approach seems fitting for the genre and it's pre-existing rich tooling and talent.


Although I'm a recovering sexp addict I must confess that I fail to see what makes the cons cell so important to those purer in their faith?

To me the homoiconity of Lisp is mainly about code-as-data, the exact nature of the data doesn't matter to me that much as long as it's a first class citizen and enclosed in nicely balanced parenthesis (though sadly here Janet seems to have fallen to the temptations of the curly braces, and thus, is indeed heresy).


I chuckled at "recovering sexp addict". What possible risk is there in over-indulging in sexp?! I simply don't see it.

Speaking of unconventional lisps, I enjoyed this recently:

https://github.com/vygr/ChrysaLisp/blob/master/docs/lisp/lis...

from Chris Hinsley, author of the (very) cool Chrysalisp operating system. Same author who wrote this in 1995:

http://www.uruk.org/emu/Taos.html


I am a heretic, but I agree that it seems the power of code as data can exist outside a linked list.

I will not give up my curly braces or square brackets.


Years ago when I was a bit obsessed about the Holy Grail of a living & breathing CRPG world the approach that seemed most promising to me then was having an expert system style AI module running on top of the complex but mechanical and boring low level simulation. This GM module would then find and tie together predefined hierarchical abstract patterns from the engines event log, adding some narration and meaning to it all and slightly nudging things along to some hopefully more interesting and meaningful paths.

I have been thinking that the current LLMs might actually make something like this more feasible, a kind of an GM in a Chinese Room that translates game events in to potential narrative arcs that the player is then free to follow if they wish. As the LLM's actions would be both inspired and limited by the game engine this would probably also tone down the problems with hallucinations and slop.


Interestingly you can also (of course) ask them to complete for System role prompts. Most models I have tried this with seem to have a bit of an confused idea about the exact style of those and the replies are often a kind of an mixture of the User and Assistant style messages.


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

Search: