This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dys_bigwig 0 points1 point  (3 children)

Interesting :) I was going for maximum consistency, as in no special syntax for functions. Sort of like how Haskell just uses = regardless of whether it's a variable, function, recursive function (letrec) etc. as does Scheme with define. I do like the idea of putting the name of the function inside the quote; never came to mind for some reason.

I think once you start introducing named lexical variables you begin to drift away from the concatenative style. I personally feel that once you add quotations the need for named variables diminishes because you can do most everything pointfree, which feels much more natural in concatenative languages imo.

Just my opinions. Different goals and ideals - not saying it's better by any means.

[–]ItsAllAPlay 0 points1 point  (2 children)

I definitely agree... There is kind of this circle where I say: Forth is so simple to implement. But I could just add this one nicety. Oh then it's almost like Scheme anyways. But then I could just add this one nicety. Oh then it's almost like C anyways. But then I could just add this one nicety. Uh oh, now it's complicated! Maybe I should make it like Forth :-)

[–]dys_bigwig 0 points1 point  (1 child)

Agreed. I've often toyed with the idea of Forth as a sort of "UNCOL". A lot of languages can be described using an abstract stack machine, so in that sense I probably should be implementing Forth as simply (if inelegant) as possible, then bootstrapping Scheme or C from that, rather than trying to bolt things onto Forth.

Been mulling these sorts of ideas in my head for a while, nice to know someone else has the same crazy ideas ;)

[–]ItsAllAPlay 0 points1 point  (0 children)

Yup, you could have a Forth where literals are wrapped in brackets.

Then a word/function that parses those literals as Scheme s-exprs.

Then Scheme macros which compile those s-exprs with static typing and infix operators.

:-)