Live data from Hacker News

Janet: a lightweight, expressive and modern Lisp

janet-lang.org

21–30 of 280 posts

Re: Janet: a lightweight, expressive and modern Lisp

#21
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…

I liked the book Practical Common Lisp (PCL) very much, you can read it online for free on the authors website: http://www.gigamonkeys.com/book/

I suggest using portacle (a preconfigured emacs) as development environment during that course as this is the easiest way to get cracking in CL imho.

Although Janet's core library is different from CL, I think once you grok LISP, it's not hard to switch to another dialect: After working through ~half of PCL I abandoned it in favour of a learning-by-doing approach in ClojureCLR as I work mostly in .NET or Mono atm.

Re: Janet: a lightweight, expressive and modern Lisp

#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 programs
  - Leverage the strengths of LISP but give it a modern overhaul (most notably, throw in different parenthesis)
Now, you may or may not subscribe to any of these but my question is just: how does Janet compete on that front? What is the problem it is trying to address specifically? I looked at the web page a bit but it's still not clear to me.

Re: Janet: a lightweight, expressive and modern Lisp

#24
post #21
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…

I liked the book Practical Common Lisp (PCL) very much, you can read it online for free on the authors website: http://www.gigamonkeys.com/book/ I suggest using portacle (a preconfigured emacs) as development environment during that course as this is the easiest way to get cracking in CL imho. Although Janet's core library is different from CL, I think once you grok LISP, it's not hard to switch to another dialect: A…

Great, I will check it out!

Re: Janet: a lightweight, expressive and modern Lisp

#25
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?

That question has been a source of multiple flamewars in the past that have only made the world worse as a result. I prefer not to go down that hole again.

Re: Janet: a lightweight, expressive and modern Lisp

#26
post #4

2020: a programming language is named Janet; a child is named X Æ A-12. How did we come to this.

It's not really something new. Ada (https://en.wikipedia.org/wiki/Ada_(programming_language) ) was created 40 years ago. Kids with crazy names is a long standing tradition, going back millenia :-)

Re: Janet: a lightweight, expressive and modern Lisp

#27
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…

It’s hard to read the bullet points on mobile — can you remove the indentation so it is formatted normally.

Other than that, good points.

Re: Janet: a lightweight, expressive and modern Lisp

#28
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…

Please don't use code blocks for quotes. It makes it very hard to read text on mobile, narrow viewports or via screen readers.

Re: Janet: a lightweight, expressive and modern Lisp

#29
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 a lisp without car cdr and cadaaaadmycateatsmiceadaddddr?

Just in case -

))))))))))))))))))))))))))))))))))))))

Re: Janet: a lightweight, expressive and modern Lisp

#30
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…

Maybe I phrased that incorrectly indeed. It's not so much that I want to find a 'better way to implement a message bus', but more 'if I want to re-implement the message bus I already have, how can I use the features of a Lisp-like languate to improve the implementation'.

For the logic in my iOS game I started out with a straighforward imperative system based on objects and explicit state, which quickly devolved in a big mess of if-then-else-but-only-if spaghetti code that was impossible to maintain. I refactored that to a reactive system based on what I call an 'event graph' where each node performs some kind of filtering or processing. For example nodes like 'filter on event type', 'take first 4 events', 'complete when event X received', etc. Game logic is implemented by branching off (subscribing) to nodes, synchronizing stuff by means of attaching a temporary subgraph that waits for a 'completion event' etc. Like I said it's quite similar to ReactiveX but simpler.

The basic concepts behind this are sound, but my feeling is that I need way too much code in to implement something like this in Lua, compared to what I would expect in something like Lisp, which seems more naturally suited for this kind of task. I just find it hard to get started trying to map the solution I already have to a Lisp language, because most of the 'introduction to Lisp'-like resources are so focused on artificial examples that are mostly interesting from a computation-theoretic point of view.

Post reply on HN