Fork me on GitHub
#announcements
<
2020-09-15
>
borkdude09:09:27

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.

👍 48
sci 27
👏 30
Eugen04:09:48

Looks awesome @plexus . Congrats. What was the use case for building it?

borkdude06:09:09

It can be used to showcase your CLJS libraries in a terminal setting.

Eugen07:09:49

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

Eugen07:09:37

@U04V15CAJ: Regarding your use case: can I load clojurescript libraries dinamically in the terminal running in my browser ?

borkdude07:09:11

@U011NGC5FFY 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.

borkdude07:09:28

But sci can be used for the things you mentioned.

borkdude07:09:39

There is a REPL example in the examples dir of sci

borkdude07:09:02

But there is also babashka.nrepl which can be used to expose an nREPL server to your sci environment.

Eugen07:09:30

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

borkdude07:09:13

yes. it's safe in the sense that you control what people can execute

borkdude07:09:50

we also have some options to restrict infinite seqs

👍 3
Eugen07:09:57

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.

❤️ 3
borkdude07:09:18

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

👍 3
borkdude07:09:10

a solution would be to run this within a thread and just kill the thread after some timeout

borkdude07:09:13

on the JVM that is. The same solution is taken by nREPL when you press ctrl-c.

borkdude07:09:06

in the browser this is more difficult

Eugen07:09:54

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 .

Eugen07:09:08

WebAssembly does support threads and can be called from JS.

borkdude07:09:25

There's also webworkers, but I don't think they can access the dom

borkdude07:09:49

The execution length problem is more or less only a problem for scripts you don't control

borkdude07:09:59

I guess the worst thing that could happen is that your browser freezes

Eugen07:09:35

🙂 for running things in browser yes, but for using sci on back-end via xterm.js ...

borkdude08:09:03

like I said, then you can run things in threads which you can kill on timeout

Eugen08:09:12

neither web workers nor web assembly can access dom. they need to do that via JS.

Eugen08:09:56

JS can call functions in WebAssembly and web Assemly can call JS so there is a lot of room for how to do that

borkdude08:09:30

cool. well, if you want to figure this out, that'd be cool

Eugen08:09:25

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.

borkdude08:09:53

The concrete use case for this is interpreting scripts from other users in something like https://github.com/athensresearch/athens

borkdude08:09:13

Maybe @U0FT7SRLP can you tell more about it

Eugen08:09:38

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 😄?

borkdude08:09:47

It's something like Roam. I have used neither myself. https://roamresearch.com/

👍 3
Eugen08:09:01

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

jeroenvandijk09:09:26

@U011NGC5FFY 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

❤️ 3
Eugen09:09:25

thanks, looks very interesting (and nice)

jeroenvandijk09:09:45

@UUY06DFL5 Might be able to explain Athens or it’s current status a bit better :)

aw_yeah 3
Eugen09:09:45

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.

jeroenvandijk10:09:01

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

plexus17:09:35

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

plexus17:09:10

To answer your question @U011NGC5FFY

borkdude17:09:10

@plexus Made various improvements to the babashka/xterm-sci. Single quotes work. Pasting multiple sexprs. Dealing with incomplete input. Println, prn, pr, etc.

borkdude17:09:08

It depends on a fork of local-echo: https://github.com/babashka/local-echo

borkdude17:09:27

Also made a PR to the original one, but they're not fast to respond

jeff tang19:09:09

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

👍 3
jeff tang19:09:15

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 @U011NGC5FFY

borkdude19:09:37

@UUY06DFL5 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.

👍 6
dominicm16:09:35

Anything exciting in JDK15 anyone knows of? I've not followed along really.

orestis16:09:15

Nashorn is truly removed

orestis16:09:22

Z1 is stable

seancorfield16:09:08

Multi-line strings with """

seancorfield16:09:25

(that's Java language, not JVM, so not useful to us)

seancorfield16:09:40

And we should probably follow-up in #java

dominicm16:09:41

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.

dominicm16:09:16

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

dominicm17:09:37

Looks like this isn't the LTS release. That'll be 1 year from now.

seancorfield17:09:29

I thought 17 is the next LTS?

dharrigan17:09:35

6 month release cycle, so 16 is next, then 17 in 1 year which is LTS.

Eugen04:09:41

There are some interesting projects in JVM / JDK land. Loom and Valhalla are probably the most interesting https://openjdk.java.net/projects/loom/

Eugen04:09:54

Loom aims to bring tail call elimination. Looking forward to seeing that.

emccue04:09:20

The devs have been pretty vocal about "LTS" not meaning anything to them

emccue04:09:58

So the latest version is the best supported version - LTS is arbitrary based on whatever companies want to do with regards to paid support

orestis06:09:37

Yes and no - eg. on AWS it’s nice to know that Amazon will apply security fixes to Coretto for a long time.

dominicm08:09:26

The clojure devs feel differently :)

dominicm08:09:45

Clojure only officially supports lts the

seancorfield16:09:14

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/

dominicm17:09:08

I'm surprised by 9/10.

tony.kay20:09:51

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

👏 27
metal 15
fulcro 18
cjmurphy22:09:41

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

metal 15
Eugen04:09:41

There are some interesting projects in JVM / JDK land. Loom and Valhalla are probably the most interesting https://openjdk.java.net/projects/loom/