Live data from Hacker News

Janet: a lightweight, expressive and modern Lisp

janet-lang.org

31–40 of 280 posts

Re: Janet: a lightweight, expressive and modern Lisp

#31
post #10

Lisp languages should be great for embedding into games to implement game logic, instead of more straightforward solutions such as embedding Lua. I've always wanted to explore this for my iOS side-project game, which now uses an event-based system inspired by ReactiveX, implemented in Lua. This works pretty well but is very hard to debug. The main thing holding me back to try to replace it with something Lisp-like is…

> but when I try to reason about common subproblems I really have no idea how to map them to something like Lisp. For example how to efficiently implement a message bus with observers that can register for certain events. I think that's a badly posed question. The main benefits of using Lisp are its introspection and interactivity. You can use the REPL to inspect your message bus at runtime, you can modify parts of i…

If he's currently using a message bus in Lua, it's likely everything is happening in a single-threaded interpreter.

Re: Janet: a lightweight, expressive and modern Lisp

#32
post #17

Is it compiled or interpreted? If interpreted does it use existing interpreter? The description mentions Lua, does it use the Lua engine? Does it have JIT? If it is compiled is it based on LLVM?

I don't know much about Janet (all I've done is complain that create-fiber did not work the way the docs say it did), but I'm pretty sure it uses its own bytecode interpreter.

Re: Janet: a lightweight, expressive and modern Lisp

#33
post #23

Okay, so when Clojure came along, it came with a strong underlying philosophy of what the language was supposed to be/do. Among them were design decisions such as, e.g.,: - VMs, not OSes, are the platforms of the future, so target the JVM - Object Orientation is overrated, but polymorphism is a good thing - Multi-core is here to stay, so use immutable data structures to greatly facilitate writing correct concurrent p…

I feel like a better description of how closure feels as a language would be something like “a functional language where everything is data and that data is flexible”. In particular the difference from a typical strongly typed functional language where basically everything is data you can dig into is that the data representation in closure is more extensible and uniform (because the types are implicit and not enforced)

Re: Janet: a lightweight, expressive and modern Lisp

#34
post #23

Okay, so when Clojure came along, it came with a strong underlying philosophy of what the language was supposed to be/do. Among them were design decisions such as, e.g.,: - VMs, not OSes, are the platforms of the future, so target the JVM - Object Orientation is overrated, but polymorphism is a good thing - Multi-core is here to stay, so use immutable data structures to greatly facilitate writing correct concurrent p…

The first point clearly didn't pan out. In reality, applications ended up bundling their own OSes along, so Clojure is stuck with antiquated VM on its ankle for no good reason.

Re: Janet: a lightweight, expressive and modern Lisp

#35
post #23

Okay, so when Clojure came along, it came with a strong underlying philosophy of what the language was supposed to be/do. Among them were design decisions such as, e.g.,: - VMs, not OSes, are the platforms of the future, so target the JVM - Object Orientation is overrated, but polymorphism is a good thing - Multi-core is here to stay, so use immutable data structures to greatly facilitate writing correct concurrent p…

What I like in Janet (I'm just a noob so take this comment with a grain of salt as it will sound superficial):

- Easy to get started: one click install, great website and concise docs. No matter what some people say, getting started in Clojure is a nightmare.

- Lightweight and fresh. No JVM, no Node.

- Freedom and expressivity. Mutable or immutable data structures, ultimately is up to me. It might bite me down the road but for now it feels great.

Re: Janet: a lightweight, expressive and modern Lisp

#37
post #10

Lisp languages should be great for embedding into games to implement game logic, instead of more straightforward solutions such as embedding Lua. I've always wanted to explore this for my iOS side-project game, which now uses an event-based system inspired by ReactiveX, implemented in Lua. This works pretty well but is very hard to debug. The main thing holding me back to try to replace it with something Lisp-like is…

If you’re interested in Common Lisp, Practical Common Lisp is a good overview of the language [1]. Since you’ve done game programming, here’s a simple snake game I wrote a while back; you might find it useful to peruse the code [2]. You can find a couple of bigger libraries I wrote on my github if you’re interested in seeing more substantial code.

[1] http://www.gigamonkeys.com/book/

[2] https://github.com/SahilKang/cl-snake

Re: Janet: a lightweight, expressive and modern Lisp

#38
post #10

Lisp languages should be great for embedding into games to implement game logic, instead of more straightforward solutions such as embedding Lua. I've always wanted to explore this for my iOS side-project game, which now uses an event-based system inspired by ReactiveX, implemented in Lua. This works pretty well but is very hard to debug. The main thing holding me back to try to replace it with something Lisp-like is…

> but when I try to reason about common subproblems I really have no idea how to map them to something like Lisp. For example how to efficiently implement a message bus with observers that can register for certain events. I think that's a badly posed question. The main benefits of using Lisp are its introspection and interactivity. You can use the REPL to inspect your message bus at runtime, you can modify parts of i…

This is a very classic Lisp answer in that "productivity" is considered in the pure abstract, and that the specific question of how to do a specific thing - the actual productive result - is uninteresting. Who would expect the classic book on Scheme to teach you how to write Scheme programs?

Re: Janet: a lightweight, expressive and modern Lisp

#39
post #22

Earlier quoted context omitted.

Yes, it seems so. Try the REPL available at the website.

I wonder if his question was not rhetorical, as in: It is really Lisp if it doesn't have cons?

Is it really Lisp without 'lists'?

https://janet-lang.org/api/index.html

that does not mention list in meaningful ways. It seems to prefer to work with other data structures (like arrays) - which is okay, but then I won't call it a List Processor dialect.

Re: Janet: a lightweight, expressive and modern Lisp

#40
post #23

Okay, so when Clojure came along, it came with a strong underlying philosophy of what the language was supposed to be/do. Among them were design decisions such as, e.g.,: - VMs, not OSes, are the platforms of the future, so target the JVM - Object Orientation is overrated, but polymorphism is a good thing - Multi-core is here to stay, so use immutable data structures to greatly facilitate writing correct concurrent p…

Yet Clojure supports a subset of CLOS, so not so much overrated after all.
Post reply on HN