News for hackers. Stuff that matters.
Re:Bio – experimental Lisp dialect, written in Zig by tmtvl on Sunday July 14, 2024 @10:29AM (#40961174)
Putting 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...

  (defun foo (list)
    (declare (type List list))
    (assert (> (length list) 1))
    (list (second list)
          (first list)))
Everything else aside it seems like a nice finger exercise for learning Zig.
Re:Bio – experimental Lisp dialect, written in Zig by cryptocod3 on Thursday July 18, 2024 @11:10AM (#40996294)
Bio 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.

Re:Bio – experimental Lisp dialect, written in Zig by 1hackaday on Sunday July 14, 2024 @11:23AM (#40961456)
Very interesting. Would be useful to know how this compares to other Lisps and what could be some use cases.
Re:Bio – experimental Lisp dialect, written in Zig by notadev2 on Sunday July 14, 2024 @11:55AM (#40961625)
"Sure, it is a good idea to call our product 'Bio' - that's a relatively unused word anyway!"

-- some stupid social recluse somewhere

Re:Bio – experimental Lisp dialect, written in Zig by the__alchemist on Sunday July 14, 2024 @12:27PM (#40961797)
This is heavy handed, but I agree. An immediate effect is confounded search results. Perhaps I'm biased as I'm writing biology software today.
Re:Bio – experimental Lisp dialect, written in Zig by frou_dh on Sunday July 14, 2024 @12:38PM (#40961861)
You 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.
Re:Bio – experimental Lisp dialect, written in Zig by cryptocod3 on Thursday July 18, 2024 @12:42PM (#40997384)
Correct
Re:Bio – experimental Lisp dialect, written in Zig by gleenn on Sunday July 14, 2024 @12:07PM (#40961701)
I 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)))

Re:Bio – experimental Lisp dialect, written in Zig by codr7 on Sunday July 14, 2024 @12:55PM (#40961956)
Functions deserve their own symbol in Lisp.

Though I prefer ^ since it’s easier to type.

https://github.com/codr7/sharpl

Re:Bio – experimental Lisp dialect, written in Zig by satvikpendem on Sunday July 14, 2024 @01:12PM (#40962078)
Haskell uses \ which is nice, it's an ASCII character that looks like the right half of λ
Re:Bio – experimental Lisp dialect, written in Zig by darby_nine on Sunday July 14, 2024 @01:14PM (#40962087)
It'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)
Re:Bio – experimental Lisp dialect, written in Zig by gylterud on Sunday July 14, 2024 @02:41PM (#40962538)
This is also what Agda does (though \ is synonymous).
Re:Bio – experimental Lisp dialect, written in Zig by brudgers on Sunday July 14, 2024 @02:50PM (#40962575)
You can use a λ in many common Rackets.
Re:Bio – experimental Lisp dialect, written in Zig by cryptocod3 on Thursday July 18, 2024 @11:13AM (#40996334)
The language supports both (λ is just an alias... which I might remove)

Replaced the example with lambda - appreciate the feedback!

Re:Bio – experimental Lisp dialect, written in Zig by revskill on Sunday July 14, 2024 @12:59PM (#40961976)
Need a dialect without using bracket.
Re:Bio – experimental Lisp dialect, written in Zig by rscho on Sunday July 14, 2024 @01:09PM (#40962055)
People complaining about parens/brackets in lisps have never really used structural editing. Change my mind!
Re:Bio – experimental Lisp dialect, written in Zig by wavemode on Sunday July 14, 2024 @01:44PM (#40962235)
Parentheses 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.
Re:Bio – experimental Lisp dialect, written in Zig by cageface on Sunday July 14, 2024 @02:00PM (#40962311)
After 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.

Re:Bio – experimental Lisp dialect, written in Zig by xigoi on Sunday July 14, 2024 @04:46PM (#40963114)
There is no ambiguity with significant whitespace.
Re:Bio – experimental Lisp dialect, written in Zig by Out_of_Characte on Monday July 15, 2024 @01:34AM (#40965516)
There is, four abstractions down,my comment gets squished as a sardine
Re:Bio – experimental Lisp dialect, written in Zig by zelphirkalt on Monday July 15, 2024 @04:58AM (#40966255)
Problem is always when you need to move code, select/highlight code, paste code, navigate code, and so on. With clear start and end markers like open and close parentheses or like "begin" and "end" in other languages, that problem does not even exist.
Re:Bio – experimental Lisp dialect, written in Zig by xigoi on Monday July 15, 2024 @05:01AM (#40966275)
Those actions have never been a problem for me. Maybe get a better editor?
Re:Bio – experimental Lisp dialect, written in Zig by zelphirkalt on Monday July 15, 2024 @06:20AM (#40966580)
Basically, you are confirming, what the original comment said. I now strongly suspect, that you have never used structured editing, which is where the issues with Python syntax are.

Where paredit for Python?

Re:Bio – experimental Lisp dialect, written in Zig by xigoi on Monday July 15, 2024 @06:26AM (#40966600)
When using structured editing, why does it matter what the syntax is? The editor is going to handle it for you anyway.

> Where paredit for Python?

I don’t know, go make it. But what would you imagine it to do? Moving blocks of indented code around is already easy without needing language-specific treatment.

Re:Bio – experimental Lisp dialect, written in Zig by zelphirkalt on Tuesday July 16, 2024 @08:24PM (#40981526)
> When using structured editing, why does it matter what the syntax is? The editor is going to handle it for you anyway.

It matters, because the start and end markers of code allow for easy recognition of where something starts and ends and make the move independent from things like indentation. In Python, if you wanted to do the same, you would have to change indentation in many cases. Also the language is less expression based, which makes it even harder to, for example slurp a block/unit of code, because it is not clear how far the slurping should go.

> I don’t know, go make it. But what would you imagine it to do? Moving blocks of indented code around is already easy without needing language-specific treatment.

Well, I am not the one claiming here, that it does not matter, whether there are start and end markers for blocks of code, so the onus is not on me to make this thing, it is up to you to prove it can be done. Lets not try to reverse the obligation of proof here.

Re:Bio – experimental Lisp dialect, written in Zig by frou_dh on Sunday July 14, 2024 @01:51PM (#40962272)
I basically agree with you, however thought the following was an interesting idea about it perhaps not always being that simple:

https://news.ycombinator.com/item?id=33166116

Re:Bio – experimental Lisp dialect, written in Zig by zelphirkalt on Sunday July 14, 2024 @02:46PM (#40962559)
Brackets? 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.
Re:Bio – experimental Lisp dialect, written in Zig by dasyatidprime on Sunday July 14, 2024 @03:21PM (#40962692)
UK English mostly treats unadorned “bracket” as referring to (), in fact, as opposed to US English which more often treats it as referring to [].
Re:Bio – experimental Lisp dialect, written in Zig by para_parolu on Sunday July 14, 2024 @11:23PM (#40965023)
In 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.
Re:Bio – experimental Lisp dialect, written in Zig by zem on Monday July 15, 2024 @05:40AM (#40966419)
in commonwealth english () are "brackets" and everything else gets the shape modifier
Re:Bio – experimental Lisp dialect, written in Zig by zelphirkalt on Thursday July 18, 2024 @09:24AM (#40995342)
In 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.

Re:Bio – experimental Lisp dialect, written in Zig by Zambyte on Sunday July 14, 2024 @01:14PM (#40962096)
Re:Bio – experimental Lisp dialect, written in Zig by apgwoz on Sunday July 14, 2024 @02:48PM (#40962565)
Re:Bio – experimental Lisp dialect, written in Zig by hayley-patton on Sunday July 14, 2024 @10:01PM (#40964715)
What's the experiment?
Re:Bio – experimental Lisp dialect, written in Zig by tfhfj on Thursday July 18, 2024 @08:06AM (#40994829)
Wow, a new Lisp dialect written in Zig? That's a combo I didn't see coming! Lisp's flexibility combined with Zig's focus on performance and safety could make for some interesting possibilities. I'm curious about how Bio handles typical Lisp features like macros and dynamic typing, especially given Zig's more static and low-level nature. Anyone tried it out yet? How does it compare to other modern Lisp dialects like Clojure or Racket in terms of ease of use and performance?
Re:Bio – experimental Lisp dialect, written in Zig by cryptocod3 on Thursday July 18, 2024 @11:21AM (#40996413)
Macros 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.