Live data from Hacker News

The Janet Language

janet-lang.org

121–130 of 203 posts

Re: The Janet Language

#121
post #72

It's a shame the new Lisps tend to not rip off Common Lisp's type system, being able to declare my types and having SBCL admonish me when I'm doing something stupid is something I would hate to lose.

Isn’t it more accurate to call that unspecified SBCL behavior than “common lisp’s type system”?

It is. SBCL does a lot of really nice things and it would be nice if someone who were to design a modern Lisp would take inspiration from it.

That said, Common Lisp is hyper advanced alien technology, so it is hard to improve upon.

Re: The Janet Language

#122

Earlier quoted context omitted.

Honestly, to me it is unreadable. Defining function inside a function inside yet another function where you use a for loop kind of function. It requires a much different line of thinking to be applicable in the real world, which goes against historic human nature of following specific instructions, one instruction at a time.

> Honestly, to me it is unreadable. Defining function inside a function inside yet another function where you use a for loop kind of function. Perhaps you think the same thing about JS where that was (and maybe still is?) a common idiom. Except that people didn't give those functions names. And for sure, it's possible to do it in all sorts of languages: python, ruby, js, go, and of course lisp I get that the syntax i…

Doing that stuff in Python would further slow down an already slow language to a crawl.

Calling non-builtin functions in cPython is super expensive.

Re: The Janet Language

#123
post #35

Earlier quoted context omitted.

What data structure isn't just a list with extra steps?

If by "list" you mean "linked list", then those are never used in practice. There is no place for this data structure in a modern CS toolbox.

That's a ridiculous statement. Linked lists have real performance benefits in some applications. A good "modern CS toolbox" includes the ability to make the right choice. Which, if you believe they are fundamentally useless, clearly you lack.

Re: The Janet Language

#124
post #108
post #86

Earlier quoted context omitted.

I tried to translate it to python, I translated (defn sum3 "Solve the 3SUM problem in O(n^2) time." [s] (def tab @{}) (def solutions @{}) (def len (length s)) (for k 0 len (put tab (s k) k)) (for i 0 len (for j 0 len (def k (get tab (- 0 (s i) (s j)))) (when (and k (not= k i) (not= k j) (not= i j)) (put solutions {i true j true k true} true)))) solutions) into def sum3(s) : """Solve the 3SUM problem in O(n^2) time.""…

One thing the Python version doesn't suffer from is lines that have to end in something like "))))". Syntax readability may be subjective, and I agree that the business logic in both examples are equally readable, but I think having to read and write a bunch of repeated punctuation at the end of a line, depending on how deeply the final statement is nested, is annoying. I don't know how Janet in particular handles er…

This is kind of unfair, unless you're in an indent based language you cannot get rid of this. The only other solution I've seen was in a pascal-like language, where you did end function NAME and that would close everything inside.

Re: The Janet Language

#126
If you like things like Janet, you might also like s7 Scheme. It is also a minimal Scheme built entirely in C and dead easy to embed. I used it to make Scheme for Max and Scheme for Pd, extensions to the Max and Pd computer music platform to allow scripting them in Scheme. (https://github.com/iainctduncan/scheme-for-max) Janet was one of the options I looked pretty closely at before choosing s7.

The author (Bill Schottstaedt, Stanford CCRMA) is not too interested in making pretty web pages, ha, but the language is great! https://ccrma.stanford.edu/software/snd/snd/s7.html

Re: The Janet Language

#127

Earlier quoted context omitted.

> I feel the need to say it every time I see new lisp-like language. Normal people don't like lisp, it looks weird. So? Normal people aren’t computing enthusiasts, so... > Are lisp-like language designers aware of that? No, lisp-like language designers have never hears the parenphobes that jump into every discussion of lisp-like languages to make their feelings known. Also, no one involved in Python, YAML, etc., has…

vaguely kinda related. I want to like lisp for its features but the syntax is too much for me to pick up without serious time investment, which I am not sure I want to make. are there any other languages that support for example lisp-like interactive REPL, eg analyzing program state while it is running?

> the syntax is too much for me to pick up without serious time investment

Umm, do you know any language with simpler syntax than Lisp has?

For me, the main problem with Lisp is that there's so many Lisps. I think I philosophically prefer Scheme over Common Lisp, but then again there are so many Schemes to choose from!

Re: The Janet Language

#128
post #100
post #90

Earlier quoted context omitted.

Sets and maps do not required hashing. Specifically std::map and std::set in the C++ standard library are based on ordered trees.

They’re often called “hash sets” or “hash maps” in other languages - they are called this for a reason, and certainly not because they could be implemented as a list. std::map is not a good example anyway, you want to consider std::unordered_map for a more appropriate comparison. C++ is weird that way. (What C++ calls a map is not what most languages call a map. std::map doesn’t even satisfy O(1). You’d be surprised…

Agree broadly that this thread has gotten too long off what was basically a joke, but!

Please measure before you make changes to your maps for perf reasons. Yeah this forum all knows their big-O, but B-tree maps like std::map often perform better than hash maps on real-world architectures.

Re: The Janet Language

#129

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.

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.

Re: The Janet Language

#130
post #42
post #39

Earlier quoted context omitted.

> Normal people don't like lisp, it looks weird. Have you considered that this is perhaps not a problem with lisp? Normal people do not much like writing computer programs at all.

The empirical evident would be against you, as tens of millions of programmers prefer writing code in those other languages that lack the parent :-)

My claim was that normal people preferred not to write any programs at all in any language. As to programmers, obviously there are smarter ones and less smart ones and to each his own.

Here, a weirdly misplaced smiley back at you :-)

Post reply on HN