Online terminal REPL implemented with xterm.js + the small clojure interpreter: https://babashka.org/xterm-sci/ source: https://github.com/babashka/xterm-sci I'm sure there are a few input/output handling edge cases. Feel free to follow up in #sci. Thanks to @plexus for the idea.
Looks awesome @plexus . Congrats. What was the use case for building it?
It can be used to showcase your CLJS libraries in a terminal setting.
thanks. From what I read it seems that I could implement a scripting terminal to my clojure / java app and expose the internals (spring beans, etc) ? Use cases would be - level 3 support, changing app behavior at runtime or doing one off scripts that are not yet exposed via api
@borkdude: Regarding your use case: can I load clojurescript libraries dinamically in the terminal running in my browser ?
@eugen.stan Not like that. Right now you would have to compile your library along and connect it into the sci options: https://github.com/borkdude/sci And then host it somewhere.
But sci can be used for the things you mentioned.
There is a REPL example in the examples dir of sci
But there is also babashka.nrepl which can be used to expose an nREPL server to your sci environment.
thanks, I love that about it. I was looking for a language that is safe to embed in an back-end app to expose internal services for maintenance operations not yet implemented in API
yes. it's safe in the sense that you control what people can execute
we also have some options to restrict infinite seqs
I will check that one up as awell, thanks. I would like to offer my appreciation for your help with clojure and in general. You are awesome and if you ever think I can help, just let me know.
but it's still possible to craft examples that will run for a long time - we haven't quite solved that problem https://github.com/borkdude/sci/issues/348#issuecomment-692985383
a solution would be to run this within a thread and just kill the thread after some timeout
on the JVM that is. The same solution is taken by nREPL when you press ctrl-c.
in the browser this is more difficult
have you looked at web assembly? I don't know if it makes any sense (just started reading about it). https://dzone.com/articles/webassembly-threads-in-firefox WebAssembly works in most modern browsers> Not sure if clojurescript could be made to work with web assembly (don't know about garbacge collection). But if it can, we can have a very powerfull clojre / clojurescript experience .
WebAssembly does support threads and can be called from JS.
browser support seems good https://caniuse.com/?search=webassembly
There's also webworkers, but I don't think they can access the dom
The execution length problem is more or less only a problem for scripts you don't control
I guess the worst thing that could happen is that your browser freezes
π for running things in browser yes, but for using sci on back-end via xterm.js ...
like I said, then you can run things in threads which you can kill on timeout
neither web workers nor web assembly can access dom. they need to do that via JS.
JS can call functions in WebAssembly and web Assemly can call JS so there is a lot of room for how to do that
cool. well, if you want to figure this out, that'd be cool
I'll look into it when I have a more concrete use case. Right now I'm just exploring WebAssembly. They do have an open spec for GC https://github.com/WebAssembly/proposals/issues/16 and a v1 implementation https://github.com/WebAssembly/gc . I think it would be worth exploring having a clojure version on web assembly once GC is in place.
The concrete use case for this is interpreting scripts from other users in something like https://github.com/athensresearch/athens
Maybe @jeroenvandijk can you tell more about it
I'm a bit ashamed to admin it's not clear what Athens does. I've looked at the github page and some other docs and as a new commer I have no idea what it does. Does it make beer π?
It's something like Roam. I have used neither myself. https://roamresearch.com/
I just read the description of Roam and I think I understand what it does. I've been looking for something like this to start a journal π . I'll check it out
btw, WebAssembly source looks very much like a LISP https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md . https://developer.mozilla.org/en-US/docs/WebAssembly/Understanding_the_text_format
@eugen.stan Regarding the (potential) power of Sci, yes Athens or Roam are future potential use cases, allowing for safe third party extensions. Sci/Clojure is a lot easier to contain than Javascript is, and a much better programming model. For current inspiration, I would look at https://observablehq.com/ this only supports javascript, but imagine a Sci variation. I think this is basically what (a part of) Athens could be
thanks, looks very interesting (and nice)
@tangj1122 Might be able to explain Athens or itβs current status a bit better :)
I'm curios about that. I'm working to grow a clojure company and I'm looking for an intranet tool. Not sure if Athens fits this profile yet.
I think the important things that are still missing are persistence and an authorization layer. So probably not a good fit yet, if thatβs not the core of your product at least
The original use case for this (and one we may still pursue) is to add a drop down repl to lambda island, and to offer various features and customizations over time via the repl
To answer your question @eugen.stan
@plexus Made various improvements to the babashka/xterm-sci. Single quotes work. Pasting multiple sexprs. Dealing with incomplete input. Println, prn, pr, etc.
It depends on a fork of local-echo: https://github.com/babashka/local-echo
Also made a PR to the original one, but they're not fast to respond
Roam allows arbitrary css, js, html, and even some hiccup and datalog. This is fun because it opens up user customization and programmable apps. But it's of course not as secure! This is why JS execution in Roam has this UI https://roamresearch.com/#/app/help/page/3l_9j6aAv
My hope is that Athens will have a plugin system that is both powerful (arbitrary code), but also safe, so something like sci would be great. But it's not a priority atm. hope that helps @eugen.stan
@tangj1122 I think the warning is great. Even with sci we cannot guarantee the length of execution time currently, but maybe allowing users to flag scripts as malicious or something would help in that regard.
JDK 15 general availability https://mail.openjdk.java.net/pipermail/announce/2020-September/000291.html
Loom aims to bring tail call elimination. Looking forward to seeing that.
The devs have been pretty vocal about "LTS" not meaning anything to them
So the latest version is the best supported version - LTS is arbitrary based on whatever companies want to do with regards to paid support
Yes and no - eg. on AWS itβs nice to know that Amazon will apply security fixes to Coretto for a long time.
The clojure devs feel differently :)
Clojure only officially supports lts the
Well, "officially support" is open to interpretation. Clojure itself is tested against 8, 9, 10, 11 right now (Oracle and OpenJDK versions) per https://build.clojure.org/job/clojure-test-matrix/
I'm surprised by 9/10.
Anything exciting in JDK15 anyone knows of? I've not followed along really.
Nashorn is truly removed
Z1 is stable
Multi-line strings with """
(that's Java language, not JVM, so not useful to us)
And we should probably follow-up in #java
https://www.techgeeknext.com/java/java15-features I'll probably look at 12/13/14 too as I didn't follow those either as I only am interested in lts versions. Not sure if they are rolled up or not.
I know we won't see clojure using this for a long time, but anonymous classes seem like they might be really handy https://openjdk.java.net/jeps/371
Looks like this isn't the LTS release. That'll be 1 year from now.
I thought 17 is the next LTS?
6 month release cycle, so 16 is next, then 17 in 1 year which is LTS.
Iβm pleased to announce Fulcro 3.3.0. This release has a few new tools that make hot code reload even better. In prior versions a change to a query when using dynamic queries would not be properly seen if nested. This new version provides a function you can call as part of your hot reload refresh that will scan for changes like that and fix them. https://github.com/fulcrologic/fulcro http://book.fulcrologic.com/#_hot_code_reload_and_dynamic_queries
Fulcro RAD now has another possibility for storage: Key Value stores (in general). The repository is setup as another RAD Demo, just to demonstrate it all working. Please take a look:Β https://github.com/fulcrologic/fulcro-rad-kvstore