Live data from Hacker News

Janet – a Lisp-like functional, imperative programming language

github.com

131–140 of 143 posts

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

#131

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. 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 decade…

> For image-based development to make sense, you really want to have long-lived interactive sessions.

Not really — most people get into a dreadful mess when they try to do that.

For most people, it works better to version and export discrete change-sets.

It makes sense to be able to save the state of your work, go to lunch, and pick up in exactly the same place when you come back.

It makes sense to be able to save the state of your work, go home, and pick up in exactly the same place when you come back the next day.

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

#132

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. 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 decade…

> … there's not necessarily any paper trail on how to rebuild the current state from scratch.

Yes there is!

"As you define and modify classes or methods, Smalltalk/V is logging all of these changes to the change log.

Every Smalltalk expression that you evaluate with either do it or show it is also logged. In addition, every time you remove a method from a class, a message is logged."

p282 "Automatic Logging of Changes"

https://rmod-files.lille.inria.fr/FreeBooks/SmalltalkVTutori...

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

#133
post #126

Earlier quoted context omitted.

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

Yes, I guess mine was more of a theoretical supposition. It was actually just an observation. Yet a moment later I wasn't really talking about that anymore, but making a more general statement regarding the exercise of debate.

Thank you for playing the role of the logic police. I guess it can sometimes be unreasonably hard to talk in a simple forum like this in a chill manner without having to deal with people's (IMO) misplaced pedantry. So be it. I'll try to be more scientific the next time.

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

#134
post #93

Earlier quoted context omitted.

I would say that if you're interested, go for it. My complaints about Janet are not too big. I feel like there are many ways to do some things, and they are all basically the same. Most of this excessive flexibility is inherited from Clojure. 1. It's never clear whether I need `cond` or can get by with `case` until I've waffled around a bit 2. I don't know whether to choose `if`, `and`, or `when`, for conditionals, b…

I'm pretty experienced with Clojure and here are my takes on those: 1. The Janet docs suggest `cond` as a replacement for if-if-else-else chains in other languages and `case` for `switch`-`case` blocks. That's a pretty good rule, although maybe you've already encountered that explanation? My main rule of thumb is that if the important value is "enum-y", representing a particular kind of thing or state, try `case`. If…

Thanks for the tips. I will try to keep these in mind so I can stop thinking so much about trivialities.

When I was using Java in my day job, I toyed with Clojure a bit and it was a pleasure. My favorite features were protocols and multi-arity functions.

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

#135

Earlier quoted context omitted.

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

Calling working as a PA "doomed" is probably the most offensive thing said yet in this thread.

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

#136
post #80

Earlier quoted context omitted.

Phil Bagwell's VList data structure seems really interesting as a way to avoid a bunch of the pitfalls of naive lists performance-wise - the paper's good fun and there seems to be an implementation in racket for anybody who wants to play with it.

The problem with a vlist is that it doesn’t maintain lisp list semantics. You can’t implement setcdr on a vlist. But you can with something like cdr-coding.

The paper discusses how to handle appends and similar.

Assuming the majority of your lists are read-only apart from appends, you can end up with something pretty performant overall.

Trade-offs all the way down as ever though.

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

#137
post #97
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.…

Have you perchance tried Gerbil as well?

I did not hear of it before. Glancing at the website, it looks rather appealing (simple language, C-friendly FFI) but I don't see anything about using Gerbil in the shebang line for scripting purposes?

I may give it a closer look sometime.

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

#138
post #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 matc…

I wasn't looking for something fast, as I'm happy to write some code in C anyway for something performance-sensitive, and most of the stuff I was going to write in Janet would be for interactive use. I was more interested in having a simple VM and a language that wasn't piling on new features every release like mainstream blub languages.

I also wanted a language that gave a straightforward mental model without an opinionated philosophy that tried to protect me from mutability and other real-world things (hence I didn't really want to go with Haskell and ~purely functional languages).

FWIW I also think the syntax errors in Janet are somewhat hard to grok.

  > So I feel like my time is better invested learning Racket instead?
I think it depends. If you want a language you can always rely on for 99% of use cases, something that covers many bases makes sense. For me, I wanted more of a fill-in-the-gaps language where neither C nor /bin/sh scripting make sense (e.g. stuff I may run on Windows or something heavy in string-handling).

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

#139
post #133

Earlier quoted context omitted.

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.

Yes, I guess mine was more of a theoretical supposition. It was actually just an observation. Yet a moment later I wasn't really talking about that anymore, but making a more general statement regarding the exercise of debate. Thank you for playing the role of the logic police. I guess it can sometimes be unreasonably hard to talk in a simple forum like this in a chill manner without having to deal with people's (IMO…

Hey, I'm just trying to explain what your comments look like to someone not involved in the original conversation, since I agreed with the statement that you objected to. Not sure where this passive aggressive defensiveness is coming from.

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

#140

Earlier quoted context omitted.

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

So for me the primary qualifier is “are functions first class”; then “can functions be defined like data” (lambda); then “does it have a rich library of functionality that allows one to program functionally with it”; then “Is fp style idiomatic” ; then probably “does it have a good method to control mutability”; then “does it control side effects” There may be some other examples in there. Personally I like things wi…

Functional style does not allow for 'evolving' a value in multiple steps. In some sense this is the heart of the difference between functional style and other styles of programming.

Language features which are only possibly used in a non-functional style make me want to say that describing the language as 'functional' is either wrong or saying a language is 'functional' is a meaningless claim. If every language is functional, saying it is completely redundant.

I like your idea of saying FP style is idiomatic in that language might qualify the language as being described as 'functional', which I think agrees with my intuition that mutable strings being built in is evidence that calling that language 'Functional' is misleading or silly.

Post reply on HN