Live data from Hacker News

Show HN: Dak – a Lisp-like language that transpiles to JavaScript

daklang.com

11–20 of 24 posts

Re: Show HN: Dak – a Lisp-like language that transpiles to JavaScript

#12
I'm enjoying reading your transpiler[0], especially how well you use generator functions. Currently I'm building a similar language in a more opinionated object-oriented style, yet I still find yours inspiring.

0. https://github.com/daaku/dak/blob/main/packages/transpiler/s...

Re: Show HN: Dak – a Lisp-like language that transpiles to JavaScript

#13
post #6

Maybe dumb question since I only have experience with a few lisps (Common Lisp, clojure and scheme) but why is this “lisp like” and not a “proper” lisp? It looks like a lisp for me with its “code is data” (homoiconic) bit and s expressions.

Describing stuff as Lisp-like is a good way to sidestep arguments about "proper" Lisp. What even is a proper Lisp? http://steve-yegge.blogspot.com/2006/04/lisp-is-not-acceptab...

Indeed Kent Pitman is on the record[1] as saying that Scheme is not "a Lisp"

1: https://groups.google.com/g/comp.lang.lisp/c/Bj8Hx6mZEYI/m/6...

Re: Show HN: Dak – a Lisp-like language that transpiles to JavaScript

#16
post #5

Interesting, in the CLJS space we recently got two new libraries in this space: https://github.com/squint-cljs/squint Which is a thin layer on top of JS https://github.com/squint-cljs/cherry Which is closer to CLJS semantics and data structures but compiles to .mjs files without any advanced optimizations etc.

I'm a huge fan of Clojure and have had a lot of fun building things with it. CLJS on the other hand has felt heavy to me, from a browser performance and dev tooling perspective. Clojure startup time always affected me more so with CLJS projects. I hope these two projects alter the landscape for the better!

Besides those aspects, Dak is different than these two specifically in that it tries to provide something closer to a minimal 1-to-1 language feature mapping to JavaScript as the base, with a goal of having essentially no runtime.

The clean room implementation has downsides - Squint and Cherry can reuse Clojure tooling like clj-kondo etc, which Dak cannot. On the other hand Dak is small, the transpiler is under 2k lines as I write this. It can run on virtually any modern JavaScript runtime (all browsers, node, deno, bun etc).

Re: Show HN: Dak – a Lisp-like language that transpiles to JavaScript

#17

I'm enjoying reading your transpiler[0], especially how well you use generator functions. Currently I'm building a similar language in a more opinionated object-oriented style, yet I still find yours inspiring. 0. https://github.com/daaku/dak/blob/main/packages/transpiler/s...

Thanks!

My fear taking this path is around performance. I've not done any profiling yet, and I'm hoping I don't regret taking this path when I get around to it.

Re: Show HN: Dak – a Lisp-like language that transpiles to JavaScript

#18
post #9

Nice work. A few years ago, I made something similar out of lumen[0] by tweaking the reader to support clojure style literals. I used hyperapp[1] as a lightweight library for react/elm style applications with a hiccup-like syntax. The code ended up looking like (h 'div { class: 'main } (h 'div {} .... Where h is the raw function for hyperapp, not a macro. I'd intended to develop my own mini-lisp with the same syntax,…

Nice! My goal in Dak is to reach a point where macros can allow transforming hiccup like syntax to hyperapp or React like function calls, or original hiccup style optimized string concat, or lit-html style template string generation. I know I could use all these for different use cases.

Re: Show HN: Dak – a Lisp-like language that transpiles to JavaScript

#19
post #13

Earlier quoted context omitted.

Describing stuff as Lisp-like is a good way to sidestep arguments about "proper" Lisp. What even is a proper Lisp? http://steve-yegge.blogspot.com/2006/04/lisp-is-not-acceptab...

Indeed Kent Pitman is on the record[1] as saying that Scheme is not "a Lisp" 1: https://groups.google.com/g/comp.lang.lisp/c/Bj8Hx6mZEYI/m/6...

and now I just miss Erik Naggum and his contributions to lisp discourse.

Re: Show HN: Dak – a Lisp-like language that transpiles to JavaScript

#20
Really reminds me of Parenscript[0], which is a subset of Common Lisp that transpiles to JS with no runtime. It's basically a thin skin around JS and it feels more like writing JS with a Lisp syntax.

What I feel is missing from Parenscript is runtime macro-expansion, hard to do without using JS to build the AST.

[0] https://parenscript.common-lisp.dev/

Post reply on HN