Live data from Hacker News

The Janet Language

janet-lang.org

141–150 of 203 posts

Re: The Janet Language

#142

Earlier quoted context omitted.

I went there, saw the Lisp syntax, and noped back out.

Same reaction here... wow that is a rough looking language. Then again I always disliked those kinds of languages like Clojure. The syntax is just too much for me. I feel like if I used it, it would atrophy my skills in other more traditional languages.

The funny thing is that it's _not_ more parentheses, roughly, than one would expect to find in any Algol/C-inspired language, like C# or JavaScript.

The opening paren is simply relocated to the other side of the function name or keyword.

What we're experiencing is just a cognitive bias which causes us to prefer the more familiar over the less familiar ([the mere-exposure effect, also called the familiarity principle](https://en.wikipedia.org/wiki/Mere-exposure_effect)).

I've never used a Lisp-family language, but I find the reaction against parentheses to be overblown.

The reading order of the code is also _consistent,_ rather than the frequent switching between infix notation, prefix notation, and postfix notation which we have to learn and parse in most languages outside the Lisp family. This is a benefit which deceptively looks like it is _more_ complicated, despite being simpler to parse visually (and otherwise). Another example of the familiarity principle at work.

Re: The Janet Language

#143

Earlier quoted context omitted.

Same reaction here... wow that is a rough looking language. Then again I always disliked those kinds of languages like Clojure. The syntax is just too much for me. I feel like if I used it, it would atrophy my skills in other more traditional languages.

The funny thing is that it's _not_ more parentheses, roughly, than one would expect to find in any Algol/C-inspired language, like C# or JavaScript. The opening paren is simply relocated to the other side of the function name or keyword. What we're experiencing is just a cognitive bias which causes us to prefer the more familiar over the less familiar ([the mere-exposure effect, also called the familiarity principle]…

Oh, I guess Markdown doesn't work. Huh. Well, shoot.

Re: The Janet Language

#144
post #93
post #21

Earlier quoted context omitted.

var distance = sqrt(x * x + y * y) That is something very similar they may had in high school.

Math notation also features one-letter variable names, weak typing and lots of ambiguity. Do you want those in code?

> weak typing

Let me disagree! The type is always one, Number (not Int or Float).

Re: The Janet Language

#145

I love Lisp (particularly Scheme), and heard that Janet was strongly inspired by Lisp and is "really Lisp underneath", but is really fast and strong at math, so I thought I'd give it a try, and after learning it I started wondering to myself, "why am I not simply using Lisp?" Though arguably lispy, Janet just wasn't lispy enough for me. It was missing the simple, elegant sexp syntax I dearly loved, and I started to w…

Uhm, sorry for asking, but are you sure you're not mistaking Janet and Julia?

Oops.. I think you're right.. It was Julia, not Janet... now I feel like an idiot, and apologize for my uncalled-for, unfair, and undeserved mischaracterization of Janet, a language I never tried.

I wish I could take it back, but HN won't let me delete my post. I apologize. Mea culpa.

Re: The Janet Language

#146

Oh hey! Nice to see this on the front page here. I love Janet -- I've been using it for about year and a half, and it's now my go-to scripting language when I need something more powerful than bash, or when I want to hack on goofy little side project (some examples in my profile). Parsing expression grammars (think, like, declarative parser combinators?) are a really great feature for ad-hoc text parsing -- and nicer…

I went there, saw the Lisp syntax, and noped back out.

Lisp syntax is a huge plus for me, and if a language doesn't have it I know it's not for me.

Re: The Janet Language

#147

One thing that bothers me about languages that compose functions like this f(g(x)) is that when programming interactively f is typically an afterthought. So, you start out with g(x) and then need to go all the way back and add f . Similarly, when x turns out like it needs to be elaborated, and you either have to go all the way back, or edit the expression in place making it longer and inevitably facing problems with…

you're totally right that it's often easier to read in the order the functions are being applied. That's why just about every lisp/scheme family language has thread-first and thread-last macros -> and ->> so f(g(h(x))) could be written as: (-> x h g f) Janet, clojure and racket and probably others have them built in, emacs lisp has it in dash.el, common lisp has it in cl-arrows and other libraries

It's really just about readability preference though not ease of editing, lisp like languages will have paredit/sexp editing shortcuts in your editor, so when you're on (f x), you press one key and it's turned into ( (f x))

Re: The Janet Language

#148

[dead]

Janet doesn’t have regular expressions built in to the language. Instead, you write parsing expression grammars. https://janet-lang.org/docs/peg.html

Spork has a regex-like syntax for constructing PEGs, but the semantics are slightly different.

And http is also part of spork, which you have to install separately. (jpm install spork)

Re: The Janet Language

#149
post #93

Earlier quoted context omitted.

Math notation also features one-letter variable names, weak typing and lots of ambiguity. Do you want those in code?

> weak typing Let me disagree! The type is always one, Number (not Int or Float).

No. There are several numeric types: ℕ, ℤ, ℚ, ℝ, ℂ, … However, mathematicians nearly always implicitly convert between them because having explicit conversions all over the place would be extremely annoying and useless.

Re: The Janet Language

#150

Earlier quoted context omitted.

Uhm, sorry for asking, but are you sure you're not mistaking Janet and Julia?

Oops.. I think you're right.. It was Julia, not Janet... now I feel like an idiot, and apologize for my uncalled-for, unfair, and undeserved mischaracterization of Janet, a language I never tried. I wish I could take it back, but HN won't let me delete my post. I apologize. Mea culpa.

You’re confusing your exes, it’s understandable. Now give Janet a fair chance if you’re single
Post reply on HN