5 ms·
So what is it good for? Edit:maybe my comment was too short, but for me it is important to know what problem a new language solves (better). And I seriously th
by andi999 5y ago
So what is it good for?
Edit:maybe my comment was too short, but for me it is important to know what problem a new language solves (better). And I seriously think the landing page does not explain it well/at all. I mean like: D is C++ done right with garbage collection (and of course expand from there). Zig and Rust are safe languages and aim to replace C (with different strategies). And of course more than one sentence.
So if anybody knows what problem Janet lang solves, pls enlighten me.
- masklinn 5y agoThe home page does happen to have everything necessary: it has a basic examples, a few blurbs, and a "use cases" explanation: > Janet makes a good system scripting language, or a language to embed in other programs. Think Lua or Guile. Janet also can be used for rapid prototyping, dynamic systems, and other domains where dynamic languages shine. I could see the sections reordered, but it's hard to really fault this home page, it's pretty terse yet quite complete. The biggest issue I have with it is the first-time reader is hit by the community / contribution bits before even knowing what the language is about. A two-columns layout would probably be useful there. And while having a basic in-page repl is nice, improving the discoverability of the language through it (e.g. providing autocompletion and inline help) would be neat.
- andi999 5y agoI disagree. 'Think Lua' is not an good explanation. I mean if I want Lua, I use Lua.
- masklinn 5y ago> 'Think Lua' is not an good explanation. Do you have reading comprehension issues that you mistake examples for explanations and are blind to the actual explanations surrounding the examples? > I mean if I want Lua, I use Lua. That I know about Lua doesn't mean I want Lua. Hell, that I wanted lua in the past doesn't mean I'm closed to replacing it with something else. Given how well-known Lua is in the space, "think lua" is a rather good example.
- andi999 5y agoWho knows? But could you point exactly to where it says why I should care about this language? Let's say I want to convince a cto to adopt it, what would be the edge one could/would gain? Maybe it has some exceptional libraries? Or GC pauses are deterministic, or whatever. I mean this landing page is/should be their 2 minutes sales pitch.
- jdmoreira 5y agoIt’s not like they are trying to sell anything. And who cares what your CTO wants to adopt? Some people simply enjoy computers and are not looking for external validation. Spin up your jvm/.net bloatware and code yet another CRUD application and leave us alone.
- deleted 5y ago[deleted]
- lightbendover 5y agoThe way people are coming out of the woodwork to aggressively dismiss someone asking about why they would use Janet over other alternatives makes it pretty apparent that there is nothing novel about this language, no reason to learn yet another scripting in a sea of choices, and a lot of over-invested individuals. You people are everything wrong with tech.
- jdmoreira 5y agoIt’s the most voted submission on HN right now. We gather here because we like this stuff. And here you are wasting your time accusing us of being everything that’s wrong with tech. The thing you fail to understand is that we aren’t in this for the money or the validation or the status. We simply like fiddling with computers, languages, etc. Computers were my hobby way before they were my job.
- IncRnd 5y ago
- galfarragem 5y agoFWIW, Janet's creator previous project was Fennel[0], a lisp that compiles to Lua. [0] https://github.com/bakpakin/Fennel https://github.com/bakpakin/Fennel
- andi999 5y agoThanks. I think for this lang the pitch is pretty clear, it looks like fennel is lisp for Lua libs (like clojure is lisp for Java) in a nutshell.
- codesections 5y agoThough note that the Fennel repo is now at https://sr.ht/~technomancy/fennel/ https://sr.ht/~technomancy/fennel/
- ojeda 5y ago> Zig and Rust are safe languages Zig is a nice improvement over C, but it is not safe. There is work in progress (https://github.com/ziglang/zig/issues/2301 https://github.com/ziglang/zig/issues/2301), but from what I can tell, key details are still to be decided, including the classes of errors that will be covered, whether they will require runtime tracking, etc. In my opinion, Zig should look into becoming UB-less -- listing undefined behavior instances like the C standard does or enabling safety only in some build modes is not enough.
- elcritch 5y agoExactly! Zig is an improvement over C in many areas, but it's fundamentally still _not_ a memory safe language. It's comparable to a modern C/C++ project setup with valgrind and allocator checks by default. The comptime is nice, but C++17 and upwards have dramatically improved the "comp time" compiling in C++.
- yumaikas 5y agoJanet's biggest draw for me was it's PEG engine and API. That is still excellent. But I'd say the biggest draw for me now is that Janet has a lot made a lot of choices I agree with. It's language that boots up very quickly, makes for easy building of CLI tools, compiles to statically linked executables, has full compile-time metaprogramming (Lisp style), and can interface with C libraries very easily. It doesn't solve any particular novel problem better outside of PEGs, but it makes a lot of the right decisions. And, being a Lisp-like, it also gives enough expressive power to help you build things your way, if you want. Most of that probably appeals to folks who a) have been programming for a while b) don't hate parens c) Are ok forging in untread territory Janet isn't something I'd build a business on, not quite yet, but it has been a very, very satisfying hobby, and I've written a lot of small tools in it, more than Nim or Go during my times with either of those.
- harryvederci 5y ago> Janet isn't something I'd build a business on, not quite yet What would you say needs to change about Janet or its ecosystem to make it business-proof?
- yumaikas 5y agoMostly just time and testing coverage, and more packages for various things. Maybe another 10,000 man-hours? I don't know the exact numbers. For context, I've found and/or helped fix bugs around multi-char string split, process termination on windows, and async IO on Windows. All things that forced me to pop the hood on the language, study relevant OS APIs, and generally yak shave, rather than focus on the task at hand. Which has been really edifying, but would have slowed me down if I was writing for a job. In the process, I've written a few libraries of my own for things like string manipulation, data schemata, rendering html forms/tables based on a schema, and so on. If you have people that are competent with C, then Janet atop that could work well, but by itself, it's still a long ways from having all of the things one might expect from Python/Ruby, let alone Java or .NET
- saikyun 5y agoI've used it to make Freja, a text editor making coding GUIs and games fun for me again. Demo: https://youtu.be/KOBi805nxNc https://youtu.be/KOBi805nxNc When comparing to non-lisps 1. It has a real REPL, so you can do live coding (this is what makes me choose it over many languages at the same "level", js, lua, python, java). Honestly, this feature alone makes or breaks languages for me. 2. It is easy to interact with C (I found this hard in js, haven't tried the other) Comparing to lisps (I've only properly tried guile & clojure) 1. Easy to build on windows / macos / linux (compared to guile which I didn't manage to build on windows) 2. Compared to clojure, just closer to the machine overall, in my case specifically OpenGL libs. I love Clojure but have had a hard time making client side apps with it. Done a bunch of CLJS stuff (e.g. card game https://animal-capital.surge.sh/ https://animal-capital.surge.sh/), but many little things get annoying (e.g. can't open my editor from a browser error, can't `eval` etc. Doesn't quite have the live coding feel).
- andi999 5y agoThanks. Could you expand on the 'real repl', what do you mean exactly? For me live coding is also important, which I do for python in Ipython so I can run the scripts, access all the modules and do what I like in the repl; if I want persistent change I have to copy it in a script before closing the session though. Is this similiar to Janet or what am I missing?
- saikyun 5y agoI'm happy you asked! :) I think these terms are very vague, and I haven't found a good way to be more clear. For me a "real repl" includes: 1. Decent support from the language to do REPLy things E.g. being able to change a function during runtime. Imagine an animation which is defined by perhaps: `(defn anim [time v] (* time v))`. Now you want to try something else, without having to recreate all state, so you just do `(defn anim [time v] (* time v v))` and hit Ctrl+L ("load file"). Oh, it seems I need to reset the animation, so I add some code to reset just the part of the state needed. Now I'm able to hit Ctrl+L and it'll run the new animation each time. The ability to do this ad-hoc anywhere in my code is so flow-inducing it's crazy. And I do this for games, web servers and browser GUIs. It's surprisingly general! 2. Editor support The Ctrl+L I mentioned above is something I do in my editor to send code from my editor to the repl server. I haven't tried Ipython, but I'm guessing it might work similarly to node, where the client and server are kind of stuck together. With a "real repl", you generally use your editor as the client. Here's a video I've made that shows how this can look: https://youtu.be/Enumt6qxAgc?t=667 https://youtu.be/Enumt6qxAgc?t=667 I know it's often possible to disconnect these (I've tried connecting my editor to the chrome debugger -- that's pretty cool!), but it doesn't seem to be in common use, which leads to... 3. Libraries supporting being run from REPLs One not-so-uncommon problem is that e.g. a web server or game loop might block the REPL. This one is probably the hardest one to fix for existing languages and their libraries. There are often ways around this, like running on multiple threads, but that can lead to new problems. Even in clojure, I've had problems due to java libraries blocking (e.g. game lib LWJGL). It doesn't help that on macos all GUI related calls must be done on the main thread (so running LWJGL on one thread and repl on other breaks things). So far with janet I've managed to solve these issues easily thanks to the event loop (which iiuc works similar to js event loop). --- I think the main thing to realize is that this way of developing leads to new possibilities of exploring software development. Suddenly you're able to experiment quicker, in a way that sometimes leads to typing speed being a bottleneck! :D It feels really cool, and I want to share this feeling of flow with as many as possible.