Live data from Hacker News

Janet – a Lisp-like functional, imperative programming language

github.com

101–110 of 143 posts

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

#101
post #11

I am a happy though very new Janet user. I started migrating my existing workflow optimization scripts (e.g. Git wrappers) to--and writing new ones--in Janet as of a few months ago. I used to use Perl but I switched to Janet as it is a much simpler language and VM, and being a Lisp is ~infinitely extensible. Janet has os/ and file/ packages, as well as a PEG system which mostly stand in for the best features of Perl.…

> Janet has os/ and file/ packages, as well as a PEG system which mostly stand in for the best features of Perl. Some low-level POSIX-specific operations (like daemonizing and forking) aren't practical but I can just use C for those.

The README briefly mention the C API. How easy is it to use it, and how easy is it to "lift" results from the C API into Janet? (e.g. wrapping an fd from the POSIX API into a file object)

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

#102

This looks really interesting, going to check this out later today. Anyone using Janet for anything that would care to comment on their experience?

I've been writing about my first impressions of the language here: https://ianthehenry.com/posts/janet-game/ Not a whole lot of content yet, but I plan to keep going with it. I am pretty firmly in the Haskell/OCaml "let me program with types" camp for most development, but it's a great to have a little scripting language to reach for instead of bash or Python or Perl. Using Janet (coming from Python) reminds me a bit…

I've thought about using Janet for a game, but there's more examples of people using love2d plus Fennel so I'm more likely to use that combination for my future Lisp game experiments. (Fennel is similar to Janet and created by the same person, but compiles to Lua.)

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

#103
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

> Haskell and Pascal, how embarassing to miss those

and Curry, while we're at it, https://curry-lang.org/

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

#104
post #73

Earlier quoted context omitted.

I think of it as one of the defining features of Smalltalk, not Lisp, although there is plenty of cross-pollination. https://en.wikipedia.org/wiki/Smalltalk#Image-based_persiste... Janet's object system seems to be modeled after ideas first popularized in the Self language -- a Smalltalk derivative -- so there could be some direct inspiration there. https://en.wikipedia.org/wiki/Self_(programming_language)

LISP I from 1960. http://bitsavers.org/pdf/mit/rle_lisp/LISP_I_Programmers_Man... page 67: SET card '...the state of the memory as it stands is read out onto tape 8 as the new "base" image for the memory...'

Damn, why don't we have programming environments with such capabilities today? (the kind @pjmlp mentioned "images, REPL with typo suggestions, OS wide debugging, code browser", etc." and so on)

Not in the @pjmlp kind of availability ("Why you say that? There's this commercial language envinronment from a company in rural Austria that all of 100 companies use and all of 1000 people ever heard of that gives you exactly that! A 2-person department in the basement, right across the toilets in Jane Street uses it for something. And somebody made a weather balloon controller with it. Plus some mid-90s research team had this in some research language that has these features, that over 10K students have installed!").

Not even in the Pharo, SBCL, etc. kind of availability.

It would nice to have it in the "competes with Java, C#, Python, Javascript, PHP" or at least Go and Rust, for popularity, adoption, libraries, websites and sources devoted to it, job opportunities, vendor support, enterprise adoption, and such" kind of availability...

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

#106
post #73

Earlier quoted context omitted.

LISP I from 1960. http://bitsavers.org/pdf/mit/rle_lisp/LISP_I_Programmers_Man... page 67: SET card '...the state of the memory as it stands is read out onto tape 8 as the new "base" image for the memory...'

Damn, why don't we have programming environments with such capabilities today? (the kind @pjmlp mentioned "images, REPL with typo suggestions, OS wide debugging, code browser", etc." and so on) Not in the @pjmlp kind of availability ("Why you say that? There's this commercial language envinronment from a company in rural Austria that all of 100 companies use and all of 1000 people ever heard of that gives you exactly…

Because those features cost money to develop, and plenty of developers nowadays want to be paid, while refusing to pay for the work of others.

So you get what is possible with long nights, weekends and abandoned university thesis after graduation, instead.

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

#107
post #11

I am a happy though very new Janet user. I started migrating my existing workflow optimization scripts (e.g. Git wrappers) to--and writing new ones--in Janet as of a few months ago. I used to use Perl but I switched to Janet as it is a much simpler language and VM, and being a Lisp is ~infinitely extensible. Janet has os/ and file/ packages, as well as a PEG system which mostly stand in for the best features of Perl.…

> Janet has os/ and file/ packages, as well as a PEG system which mostly stand in for the best features of Perl. Some low-level POSIX-specific operations (like daemonizing and forking) aren't practical but I can just use C for those. The README briefly mention the C API. How easy is it to use it, and how easy is it to "lift" results from the C API into Janet? (e.g. wrapping an fd from the POSIX API into a file object…

Good question :) I actually haven't had a good excuse to use the C API yet. When I need C I just code the entire tool in C, or use IPC.

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

#108

Earlier quoted context omitted.

>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

Can’t decide if “if it looks like a female secretary then it’s a woman” is progressive or backwards.

I suppose that depends on whether you think women should be doomed to the role but it takes some extraordinary imagination to pretend the stereotype doesn't exist, or that one gets around it by making the woman in question an artificial one

kinda like if I made a software called arnold with a picture of he-man as a logo I doubt one would be considered backward for thinking I had a guy in mind

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

#109

Earlier quoted context omitted.

> Janet has os/ and file/ packages, as well as a PEG system which mostly stand in for the best features of Perl. Some low-level POSIX-specific operations (like daemonizing and forking) aren't practical but I can just use C for those. The README briefly mention the C API. How easy is it to use it, and how easy is it to "lift" results from the C API into Janet? (e.g. wrapping an fd from the POSIX API into a file object…

Good question :) I actually haven't had a good excuse to use the C API yet. When I need C I just code the entire tool in C, or use IPC.

Dumb question: Is IPC Inter-Process Communication? Or is it an unrelated tool?

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

#110

Earlier quoted context omitted.

> 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).

Simply false. For example, LISP 1.5 manual had this definition for UNION:

  (union (lambda (x y) (cond ((null x) y) ((member
         (car x) y) (union (cdr x) y)) (t (cons (car x)
         (union (cdr x) y))))))
It had a MAPLIST (today called MAPCAR):

  maplist[x;fn]=[null[x]->NIL;
                 t->cons[fn[x];maplist[cdr[x];fn]]]
Or APPEND:

  append[x;y] = [null[x] -> y; T -> cons[car[x]; append[cdr[x];y]]]
Et cetera. Sure, it also had, say, NCONC. But it had these operators and style from the beginning, not surprisingly, as Lisp came from lambda calculus.
Post reply on HN