Live data from Hacker News

Janet: a lightweight, expressive and modern Lisp

janet-lang.org

191–200 of 280 posts

Re: Janet: a lightweight, expressive and modern Lisp

#191
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.

Sorry, I didn't even realize that it was a code block when I wrote the post.

Re: Janet: a lightweight, expressive and modern Lisp

#192

I don't use lisp languages, but one basic difference this has from other lisps is that functions accept multiple expressions, e.g.: (defn greet [firstname lastname] (def fullname (string firstname " " lastname)) (string "Hello, " fullname)) In other lisps, you'd have the last expression nested inside a `let` block: (defn greet [firstname lastname] (let [fullname (string firstname " " lastname)] (string "Hello, " full…

in Racket you can do it either way, and perhaps these sorts of issues should just be solved with an auto code formatter?

Re: Janet: a lightweight, expressive and modern Lisp

#193
post #169

Earlier quoted context omitted.

> Even your way has two completely different code paths (import vs require) to bring in dependencies. import and require have different purposes though, it makes perfect sense to me that they are separate. Import, here, is used to import Java classes, which don't hook into Clojure's namespaces directly; require is for bringing in symbols from Clojure namespaces. In general, a beginner or intermediate Clojure user wil…

> For what it's worth, having used Clojure for work for a couple years now... > ...it makes perfect sense to me that they are separate... > A lib’s container is a Java resource whose classpath-relative path is derived from the lib name [0] > No matter what some people say, getting started in Clojure is a nightmare. ~ galfarragem (earlier in the thread). I'm hoping this smorgasbord of quotes is making my point for me…

No, these are not making your point for you. You bring up :import and :use, but in truth, a beginner or intermediate Clojure user is not going to use either of them at all; and when they choose to, it'll be because they have some deeper knowledge which will make the documentation appropriate to them. :import is primarily for people who understand Java and the JVM. If you know what you're importing, you will understand :import quickly; if you don't know what you're importing, you have no use for :import anyway. In the case of :use, nobody needs :use; it is useful primarily to the people who know why it is useful, and the documentation for it is suitable for that audience.

Getting started in Clojure is not a nightmare, ordinary people do it all the time, the fact that somebody said it was a nightmare says very little.

Clojure's mechanism for requiring packages is far from byzantine, whether you "budge" on that or not; many Clojure libraries have the snippet for including the current stable release of that library at the top of their README on GitHub. It isn't matter of "sticking with it" or "figuring out something that works for you", it is literally one relatively simple piece of knowledge that is learned once and works forever.

In short, if you find namespaces and importing byzantine in Clojure, you are probably at the level of struggling to write fizzbuzz in any language. The fact that there are features other than :require in ns does not indicate that :require is complicated, it just indicates that ns has features.

Re: Janet: a lightweight, expressive and modern Lisp

#194

I don't use lisp languages, but one basic difference this has from other lisps is that functions accept multiple expressions, e.g.: (defn greet [firstname lastname] (def fullname (string firstname " " lastname)) (string "Hello, " fullname)) In other lisps, you'd have the last expression nested inside a `let` block: (defn greet [firstname lastname] (let [fullname (string firstname " " lastname)] (string "Hello, " full…

In common lisp `defun` does not require using `let`.

Re: Janet: a lightweight, expressive and modern Lisp

#195

I don't use lisp languages, but one basic difference this has from other lisps is that functions accept multiple expressions, e.g.: (defn greet [firstname lastname] (def fullname (string firstname " " lastname)) (string "Hello, " fullname)) In other lisps, you'd have the last expression nested inside a `let` block: (defn greet [firstname lastname] (let [fullname (string firstname " " lastname)] (string "Hello, " full…

> which makes the code hard to read and edit IMO. Languages like Haskell and OCaml suffer from a similar problem too.

That's interesting, I've always really loved the "return last expression in a block" syntax. (Ruby and Rust can be added to your list as well.) That syntax just reads really naturally to me.

Re: Janet: a lightweight, expressive and modern Lisp

#196
post #101
post #36

Can't find the tutorial or language manual.

I see no tutorial either, but did you try clicking the prominent link near the top labeled “Documentation”? The language manual seems to be all there. Once you're inside the documentation, there is a hamburger menu exposing a comprehensive table of contents.

I am an idiot. Somehow I went to the API documentation and examples instead on the github site. Thanks.

Re: Janet: a lightweight, expressive and modern Lisp

#197
post #61

Earlier quoted context omitted.

> No matter what some people say, getting started in Clojure is a nightmare. You just need Java installed on your system, then you install clojure (via brew, or sh install) and that's it, you're good to go. I've written a guide to starting with Clojure covering installation to REPL & IDE configuration: https://grison.me/2020/04/04/starting-with-clojure/

A lot of tutorials assume the use of lein, which isn't part of Clojure, and isn't properly packaged for windows.

Running the batch file that comes with the project works for me and has worked on a variety of versions of Windows. I haven't had as much luck with the "clj" tool.

I don't see who the "clj" shell script is somehow "part of Clojure" any more than Leiningen or Boot. IMHO it's just a shell script and it works similarly to the other tools, except not in any way cross platform.

Re: Janet: a lightweight, expressive and modern Lisp

#198
post #195

I don't use lisp languages, but one basic difference this has from other lisps is that functions accept multiple expressions, e.g.: (defn greet [firstname lastname] (def fullname (string firstname " " lastname)) (string "Hello, " fullname)) In other lisps, you'd have the last expression nested inside a `let` block: (defn greet [firstname lastname] (let [fullname (string firstname " " lastname)] (string "Hello, " full…

> which makes the code hard to read and edit IMO. Languages like Haskell and OCaml suffer from a similar problem too. That's interesting, I've always really loved the "return last expression in a block" syntax. (Ruby and Rust can be added to your list as well.) That syntax just reads really naturally to me.

I like that too, but both Rust and Ruby allow multiple expressions/statements before the last expression. In Haskell and OCaml IIUC you need to use things like `let x = ... in ` or ` where x = ...`, so you still have a single expression in function bodies.

Re: Janet: a lightweight, expressive and modern Lisp

#199

Earlier quoted context omitted.

Well, Oracle JDK is a non-starter outside enterprise settings these days. You should be using Zulu or Corretto, and both are much easier to download.

No, you should almost certainly be using openjdk, which oracle jdk is based off, unless you have a compelling reason an alternative implementation is better.

Zulu and Corretto are both distributions of OpenJDK.
Post reply on HN