Live data from Hacker News

Janet – a Lisp-like functional, imperative programming language

github.com

81–90 of 143 posts

Re: Janet – a Lisp-like functional, imperative programming language

#81
post #10

Why use this over Chicken Scheme?

A copy-paste from "Use Cases" in Janet's README.md: Janet makes a good system scripting language, or a language to embed in other programs. It's like Lua and Guile in that regard. It has more built-in functionality and a richer core language than Lua, but smaller than GNU Guile or Python.

Chicken Scheme also makes a good language to embed in other programs. As does Gambit.

They are Schemes though.

Re: Janet – a Lisp-like functional, imperative programming language

#82
post #30

Off topic: Is it just me or are there any others who find naming programming languages with women's names a bit weird? Julia, Janet, Eve... I understand the guy referring to his car as his "girlfriend" and give it a women's name. I just can't feel the same about tech. I guess this may be the nerd's way of immortalizing their sweetheart, but if I was a woman I'd rather prefer to be a car and not a programming language…

Not named after a woman (or rather, named after not-a-woman): https://github.com/janet-lang/janet#why-is-it-called-janet

>not-a-woman

given that the character of the show in question is an archetypal secretary arguing it's not a woman is a fairly big stretch. Not only is it a woman, it's a woman embodying a female stereotype, (in line with the purpose of the language, being an easy helper), and the 60s art deco woman's magazine style logo

Re: Janet – a Lisp-like functional, imperative programming language

#83
post #30

Off topic: Is it just me or are there any others who find naming programming languages with women's names a bit weird? Julia, Janet, Eve... I understand the guy referring to his car as his "girlfriend" and give it a women's name. I just can't feel the same about tech. I guess this may be the nerd's way of immortalizing their sweetheart, but if I was a woman I'd rather prefer to be a car and not a programming language…

Ada, Alice... Interesting question, but it might just be a yellow volkswagon effect. Quickly looking at Wikipedia's list of languages, theres Babbage, Bertrand, Cecil, Darwin, Dylan, Escher, Euclid, Euler, Godel, Hume, Orwell, Tom, Zeno, and probably a few others I missed. EDIT: Haskell and Pascal, how embarassing to miss those

[deleted]

Re: Janet – a Lisp-like functional, imperative programming language

#84

Maybe I'm just too pedantic, but this is not a functional language. Yes, you can write functional style code, but you can write functional style code in C, C++, Java, Python, JS, Ruby, Common Lisp, Scheme, etc etc. That does not make any of these languages 'functional'.

Is this Scheme/Common Lisp? Where are the cons cells?

Nope. There are no cons cells here.

Re: Janet – a Lisp-like functional, imperative programming language

#85
post #30

Off topic: Is it just me or are there any others who find naming programming languages with women's names a bit weird? Julia, Janet, Eve... I understand the guy referring to his car as his "girlfriend" and give it a women's name. I just can't feel the same about tech. I guess this may be the nerd's way of immortalizing their sweetheart, but if I was a woman I'd rather prefer to be a car and not a programming language…

I mean, this is done well outside programming languages. See; for example, tropical hurricanes.

That used to be true, but hurricanes haven't been named exclusively after women since 1978.

> The practice of naming hurricanes solely after women came to an end in 1978 when men's and women's names were included in the Eastern North Pacific storm lists. In 1979, male and female names were included in lists for the Atlantic and Gulf of Mexico.

https://www.nhc.noaa.gov/aboutnames_history.shtml

Re: Janet – a Lisp-like functional, imperative programming language

#86

Why use this over Chicken Scheme?

While we are at this topic: why use Chicken Scheme over this?

Decent amount of libraries (eggs) for one(and a package manager). Follows a language spec (R5RS).

Then we get to the personal preferences territory. You may prefer a Scheme(with its hygienic macros and other goodies). Or the way it generates C code (which is then compiled).

As an example. At one time I was experimenting with writing iOS games in Scheme. The usual option would be cross-compilation. I would cross compile my Scheme program as a library and add the to project. But XCode is annoying because it wants ARM code for the actual device, and X86 code for the simulator. Rather than building a complicated build system, I just told Chicken to stop at C code generation, then added the generated code to the XCode project. XCode could now compile the entire thing as if it was all C+Objective C code in the first place. Add a couple of instructions for the actual embedding and there's my hybrid Scheme+Objective C program.

Related to the example above, I was missing an OpenGL ES library. But I found a similar library from Gambit Scheme. Given that they are both Scheme, the code would work with almost no changes. The only changes were related to the foreign function interface (to call C), which were not standardized. So I just wrote a 'compatibility' macro, and the code would now run.

Ultimately though, it's all up to you. I'm just happy there's always some healthy baseline interest in Lisp-like languages.

Re: Janet – a Lisp-like functional, imperative programming language

#87
post #30

Off topic: Is it just me or are there any others who find naming programming languages with women's names a bit weird? Julia, Janet, Eve... I understand the guy referring to his car as his "girlfriend" and give it a women's name. I just can't feel the same about tech. I guess this may be the nerd's way of immortalizing their sweetheart, but if I was a woman I'd rather prefer to be a car and not a programming language…

[deleted]

Re: Janet – a Lisp-like functional, imperative programming language

#88

Maybe I'm just too pedantic, but this is not a functional language. Yes, you can write functional style code, but you can write functional style code in C, C++, Java, Python, JS, Ruby, Common Lisp, Scheme, etc etc. That does not make any of these languages 'functional'.

> Yes, you can write functional style code, but you can write functional style code in C, C++, Java, Python, JS, Ruby, Common Lisp, Scheme, etc etc. That does not make any of these languages 'functional'. Lisp-family languages (both CL and its immediate predecessors, and Scheme) for a long time were the textbook example of functional languages. The relatively novel (and still niche) attempt to redefine things so that…

This is not correct, lisp operations on lists have always been to modify in place, with copying versions added later. The technology did not exist to do functional programming efficiently enough (and to some extent that technology still does not exist generally).

Re: Janet – a Lisp-like functional, imperative programming language

#89

Maybe I'm just too pedantic, but this is not a functional language. Yes, you can write functional style code, but you can write functional style code in C, C++, Java, Python, JS, Ruby, Common Lisp, Scheme, etc etc. That does not make any of these languages 'functional'.

Functional doesn't really have a consistent definition, and you end up always with "yeah but"s in any discussion e.g. haskell isn't functional because C ffi and unsafePerformIO. Point being, its very hard to say "X is or is not functional", as there isn't an objective consideration. (FYI, I love Haskell and use it daily and write it professionally)

This language has mutable strings. This is in some sense the opposite of functional style.

Re: Janet – a Lisp-like functional, imperative programming language

#90

Earlier quoted context omitted.

(Not a lisp guy). What is an image and why would I want to run one? My best guess is that an image would be platform independent bytecode vs compiled executable?

When folks run emacs, they aren’t actually starting it entirely from scratch. They are booting up a similar “image”, which allows for much faster startup. The lack of image support is what prevents Clojure from competing on startup time (but see also grallvm and babashka)

There are also the JIT caches on HotSpot, OpenJ9 and Azul.
Post reply on HN