Live data from Hacker News

Janet – a Lisp-like functional, imperative programming language

github.com

121–130 of 143 posts

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

#121
post #32
post #28

Earlier quoted context omitted.

Why do you mean by ‘throw exceptions from C’? C has no exceptions.

In libjanet you can use a C call like janet_panic() that'll "panic" and throw an exception/error up in the active Janet runtime (so when something bad/unexpected happens in your C code you are providing an API to from Janet, you'd use this).

This is what I was referring to, sorry for being unclear. :)

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

#122

What's the advantage of not having lists? How does this affect one's programming style versus Scheme or Common Lisp (or Emacs Lisp, honestly the Lisp I'm most familiar with)?

You can access any element in your array in O(1). I think it is faster to loop through as well, but I'm not so sure about that.

The drawback is that appending / removing elements at the beginning of the array is O(n).

When it comes to interacting with the collections I mostly use the loop / seq macros, which I believe are pretty similar to Common Lisp. Ofc you also have map / filter / reduce.

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

#123
I would like to have a language like this that is easy to bind C++ (including classes) code to in a way as easy as ChaiScript.

I did several experiments for a side-project. The end result was that I moved from ChaiScript (no generators or fibers or lightweight concurrency) to Wren language.

I saw Janet, and I was very tempted, but nothing like WrenBind17 exists for it AFAIK.

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

#124
post #78

Earlier quoted context omitted.

> Why do you assume programming langauges with female coded names are because the creator is viewing it as a girlfriend? I am not assuming that. I was just comparing it to the situation with cars. > Not all creators are heterosexual males (or otherwise oriented toward females as preferred or even acceptable romantic partners), and even those that are don’t necessarily view women exclusively through the lens of romant…

> I am not assuming that Well you did say: "this may be the nerd's way of immortalizing their sweetheart", which seems to me to strongly imply that your impression may be closer to assuming it than to not assuming it. I have no horse in this race (I'm not the one who replied to your original comment), but it did seem like you were assuming something awful close to what you are denying.

In my world saying that "something may be something for other people" doesn't equal to "personally assuming that something is something". But I understand where you come from.

For me the thinking & debating exercises doesn't have to involve taking a position personally. Sometimes I just want to focus on the argument. My own position & assumptions are irrelevant.

For that reason I don't appreciate it when somebody makes an assumption regarding my assumptions to attack myself instead of focusing on the argument.

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

#125
post #124

Earlier quoted context omitted.

> I am not assuming that Well you did say: "this may be the nerd's way of immortalizing their sweetheart", which seems to me to strongly imply that your impression may be closer to assuming it than to not assuming it. I have no horse in this race (I'm not the one who replied to your original comment), but it did seem like you were assuming something awful close to what you are denying.

In my world saying that "something may be something for other people" doesn't equal to "personally assuming that something is something". But I understand where you come from. For me the thinking & debating exercises doesn't have to involve taking a position personally. Sometimes I just want to focus on the argument. My own position & assumptions are irrelevant. For that reason I don't appreciate it when somebody mak…

I don't see anything in dragonwriter's response that attacks you and not your argument. Perhaps you just disagree with the phrasing, but to me, "you assume" in this context is short for "you assume in your argument" or "your argument assumes" and it still looks valid.

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

#126
post #124

Earlier quoted context omitted.

In my world saying that "something may be something for other people" doesn't equal to "personally assuming that something is something". But I understand where you come from. For me the thinking & debating exercises doesn't have to involve taking a position personally. Sometimes I just want to focus on the argument. My own position & assumptions are irrelevant. For that reason I don't appreciate it when somebody mak…

I don't see anything in dragonwriter's response that attacks you and not your argument. Perhaps you just disagree with the phrasing, but to me, "you assume" in this context is short for "you assume in your argument" or "your argument assumes" and it still looks valid.

> "you assume" in this context is short for "you assume in your argument" or "your argument assumes" and it still looks valid

An argument doesn't assume, but it states. Assumption is something people do. When somebody makes a statement regarding "what an argument assumes", the meaning is that they are speculating beyond what the argument is stating.

So I don't agree with you, but thank you for the discussion.

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

#127
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.…

I've also played with it but it's still feels like a toy language? Not particulary fast and also the messages are not particulary useful when you make syntax errors. Some aspects of it are nice though. If you come from imperative programming background, it's easier to write code in Janet compared to Scheme. Easier to use than Racket, but then again Racket has lots of features and libraries: PEG, regexps, pattern matching, you name it. So I feel like my time is better invested learning Racket instead?

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

#128
post #106

Earlier quoted context omitted.

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.

> 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. Yes, but v8, Grail, the JVM, .NET takes lots of money to develop as well. Even Swift (despite Apple being stingy, so that is probably just a 5 person team force-fed Jolt Cola) costs a lot. But companies seem to pay for those, but not for those other styles/features. To be fr…

My take is that this feature is fundamentally at odds with how most programming languages work.

For starters, I think that it's probably no accident that you generally only see these image-based development features in dynamically typed languages. For image-based development to make sense, you really want to have long-lived interactive sessions. In Smalltalk, they are effectively endless, and can span multiple decades and branch among thousands of people. In a static language, though, you've got an incentive to keep your interactive sessions short and do most of your development outside of it, because code changes inside the interactive session can lead to weird chicken-and-egg problems.

Second, there are some real ergonomic challenges. It's easy to get into a state where what you're doing isn't reproducible, because there's not necessarily any paper trail on how to rebuild the current state from scratch. This is a famous criticism of Microsoft Excel - arguably the world's most widely used fully interactive development environment along these lines - and a major reason why a major project at of one of my previous jobs was to replace one department's suite of heavily scripted Excel spreadsheets and replace it with a C# application. The company was rightly concerned that they were one file corruption away from a major business disruption. Similar criticisms, albeit on a less operatic scale, are often leveled against Jupyter notebooks, which aren't quite the same thing, but to retain many relevant features.

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

#129
post #126

Earlier quoted context omitted.

I don't see anything in dragonwriter's response that attacks you and not your argument. Perhaps you just disagree with the phrasing, but to me, "you assume" in this context is short for "you assume in your argument" or "your argument assumes" and it still looks valid.

> "you assume" in this context is short for "you assume in your argument" or "your argument assumes" and it still looks valid An argument doesn't assume, but it states. Assumption is something people do. When somebody makes a statement regarding "what an argument assumes", the meaning is that they are speculating beyond what the argument is stating. So I don't agree with you, but thank you for the discussion.

An argument assumes if it doesn't back up the assertion with reasoning. For an argument to state, it needs more; as written, it wasn't really an argument to begin with. It was just a theoretical supposition.

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

#130
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…

> Damn, why don't we have programming environments with such capabilities today?

Do you use any of the image based programming environments that we do have? Pharo? VM Smalltalk?

Post reply on HN