Bio – Experimental Lisp dialect, written in Zig
90 points by montyanderson 1 year ago | 34 comments- 1hackaday 11 months agoVery interesting. Would be useful to know how this compares to other Lisps and what could be some use cases.
- hayley-patton 11 months agoWhat's the experiment?
- tmtvl 11 months agoPutting closing parentheses on their own lines is extremely cursed.
I used to like Lisp-1s when I used Scheme, but having used Common Lisp for a while I've come to appreciate Lisp-2s, if only for silly things like...
Everything else aside it seems like a nice finger exercise for learning Zig.(defun foo (list) (declare (type List list)) (assert (> (length list) 1)) (list (second list) (first list)))
- cryptocod3 11 months agoBio dev here, time to create a HN account I guess. Got a nod that someone posted about it here, which I would prefer to happen a few years from now given the early stage, but hey what can you do :)
I 100% agree with formatting and I've started fixing it, the leftovers were from some (misguided) experimenting.
- 11 months ago
- cryptocod3 11 months ago
- notadev2 11 months ago[flagged]
- frou_dh 11 months agoYou know, when someone creates the millionth homegrown lisp/scheme interpreter, they're probably not particularly concerned about SEO or "product", and are just hacking for the fun of it.
- cryptocod3 11 months agoCorrect
- cryptocod3 11 months ago
- the__alchemist 11 months agoThis is heavy handed, but I agree. An immediate effect is confounded search results. Perhaps I'm biased as I'm writing biology software today.
- frou_dh 11 months ago
- tfhfj 11 months ago[flagged]
- cryptocod3 11 months agoMacros and dynamic typic works fine, but performance is terrible for now as it's an AST interpreter. My main focus is going forward will be to finish the vm/jit backend.
There are at least a couple of other Lisps written in Zig, though I'm not sure about the state. One is in the Mal repository, the other was targeting WASM iirc.
- cryptocod3 11 months ago
- revskill 11 months agoNeed a dialect without using bracket.
- rscho 11 months agoPeople complaining about parens/brackets in lisps have never really used structural editing. Change my mind!
- wavemode 11 months agoParentheses in lisp are a lot like significant indentation (Python, Haskell, etc), in that people tend to complain about it "from afar". It is only once they start actually using the language to develop something nontrivial, that they realize that you quickly stop noticing the syntax entirely.
- cageface 11 months agoAfter 20 years of using python I still think significant whitespace is a flaw.
It saves a little bit of typing in exchange for a lot of ambiguity.
- frou_dh 11 months agoI basically agree with you, however thought the following was an interesting idea about it perhaps not always being that simple:
- cageface 11 months ago
- wavemode 11 months ago
- Zambyte 11 months agoThere is this: https://srfi.schemers.org/srfi-119/srfi-119.html
- apgwoz 11 months agoEveryone forgets about Dylan. (https://en.wikipedia.org/wiki/Dylan_(programming_language)?w...)
- apgwoz 11 months ago
- zelphirkalt 11 months agoBrackets? That's easy! Just use parentheses instead! I guess you mean parentheses. Perhaps I am unaware of some meaning of brackets, that also describes parentheses, but afaik parentheses are different from brackets.
- dasyatidprime 11 months agoUK English mostly treats unadorned “bracket” as referring to (), in fact, as opposed to US English which more often treats it as referring to [].
- para_parolu 11 months agoIn Russian words parentheses, brackets and braces are represented by the same word with modifier (round, square, figure, etc) I always have problem when speaking English because can’t remember which one is which.
- zelphirkalt 11 months agoIn German the same happens:
"runde Klammern" for (), "eckige Klammern" for [], and "geschweifte Klammern" for {}.
Although when you say only "Klammern" people usually understand (), because that is what is often used in texts.
This translates well:
runde Klammern --> parentheses, eckige Klammern --> brackets, geschweifte Klammern --> braces.
As such, the US English understanding of the words is clearer to me, than a non-distinguishing understanding.
- zem 11 months agoin commonwealth english () are "brackets" and everything else gets the shape modifier
- zelphirkalt 11 months ago
- dasyatidprime 11 months ago
- rscho 11 months ago
- gleenn 11 months agoI see they use they use the actual lambda character "λ" to create functions which is both cool and also probably makes grepping for functions a PITA. It does look pretty but I would have to search the web or write down the random keystroke to generate that symbol.
An example usage:
(filter (quicksort '(5 40 1 -3 2) <) (λ (x) (>= x 0)))
- satvikpendem 11 months agoHaskell uses \ which is nice, it's an ASCII character that looks like the right half of λ
- darby_nine 11 months agoIt's pretty common to wire \ to the lambda character in your editor. I think racket already allows this (if not as a replacement for lambda, an alternative syntax for it)
- codr7 11 months agoFunctions deserve their own symbol in Lisp.
Though I prefer ^ since it’s easier to type.
- cryptocod3 11 months agoThe language supports both (λ is just an alias... which I might remove)
Replaced the example with lambda - appreciate the feedback!
- 11 months ago
- gylterud 11 months agoThis is also what Agda does (though \ is synonymous).
- brudgers 11 months agoYou can use a λ in many common Rackets.
- satvikpendem 11 months ago