3 ms·
Just a couple examples (below) of what the code looks like. Sigils differentiate between scalars and collections (lists only at the moment). Functions can be
by fogus 18y ago
Just a couple examples (below) of what the code looks like. Sigils differentiate between scalars and collections (lists only at the moment). Functions can be passed by name and called either directly (in parens) or indirectly (with the call function). Written in C and Broccoli. Nothing incredibly earth-scattering, but it is my attempt to write the language that I would like to code in.
- aggieben 18y agoOk, but, still: why broccoli? At first blush it looks similar to Arc (granted, I don't know much about Arc) or any other implementation of Scheme or Common Lisp. What's special about Broccoli?
- fogus 18y agoIt is very different than arc (read: less powerful) as it is not really a functional language, has no concept of anonymous functions (although that would be easy enough to add), has no closure, has no continuations, and has no macro facility. The only thing that I have taken from arc is the naming of the defun function.
- SwellJoe 18y agoIt's interesting that you've opted to use Perl-style sigils, given the hatred many programmers experience when seeing them (pg covers it with "no swearing" in his arc guidelines). I happen to like them, particularly for interpolation in strings...and strings are so much of what we do with web applications. "There are $number posts" is much more pleasant, to me, than "There are " . number . " posts". But I might be weird, and there does seem to be an aversion to them in most recent languages that have achieved popularity.
- fogus 18y agoI too like sigils for two reasons: 1) Makes str interpolation (as you mentioned) easier on the eyes. 2) I like to see, at a glance, what a variable "is doing". In Broccoli, there are only two "doings" hold values, or holding a collection of values. 3) I know I said 2, but the real reason.... it is easier to parse. ;) -m