announcements

Project/library announcements ONLY - use threaded replies for discussions. Do not cross post here from other channels. Consider #events or #news-and-articles for other announcements.
alexmiller 2021-02-08T04:17:20.221500Z

Guaranteed Rate commercial during the Super Bowl had some Clojure on screen ...Β https://youtu.be/Nf0QvCq3quk?t=38

38
🏈 13
alexmiller 2021-02-08T04:18:26.221800Z

Not sure what editor that is?

prertik 2021-02-08T04:21:28.222400Z

Looks like vim(spacevim) to me.

2021-02-08T04:29:29.223200Z

2021-02-08T04:31:25.223400Z

Can anyone read it?

2021-02-08T04:32:05.223600Z

I can read parts of it πŸ˜…

2021-02-08T04:46:43.223900Z

Is Clojure famous now? 😎

☝️ 1
chucklehead 2021-02-08T05:10:33.224500Z

this frame has a reasonably legible view of the left pane w/ create- and update-loan! functions, middle pane is some functions for rates, can't read anything on the right

djblue 2021-02-08T05:52:27.225100Z

That's a lot of chrome tabs!

chucklehead 2021-02-08T06:10:39.225600Z

I'll often have multiple instances with at least that many tab open and I think it makes my girlfriend physically ill when she happens to look over my shoulder

2
chucklehead 2021-02-08T06:12:33.225800Z

on the other hand, the only thing on my desktop is my recycle bin and I'm suspicious of anyone who leaves documents and folders all over theirs.

tony.kay 2021-02-08T06:20:42.226200Z

Grokking Fulcro part 2 is now available: https://youtu.be/102nHLzIbE4

πŸŽ‰ 9
2021-02-08T06:20:54.226300Z

Ooh I just learned about the , and . keys on youtube to go back and forward a single frame. You can definitely get clearer screenshots that way!

🀯 1
slipset 2021-02-08T06:42:29.228200Z

β€œHow did an underdog, always counted out, take down the biggest name?” I think Clojure was a reasonable choice of PL for this add.

🀘 15
2021-02-08T10:16:22.230900Z

Ever want to use Clojure like it was PHP on cheap servers? Now you can by combining Babashka with cgi-scripts on shared hosts! Learn more about the process at https://eccentric-j.com/blog/clojure-like-its-php.html. See an example at https://cgi.eccentric-j.com/metal.clj. View the source, then discover some helpful scripts, docker-files, and hints at https://github.com/eccentric-j/clj-cgi-example.

6
πŸ‘ 6
🀯 11
πŸ™ƒ 2
2021-02-08T10:17:12.231300Z

Major thanks to @borkdude and @didibus, would not have gotten to this point without your help!

Tomas Brejla 2021-02-08T10:38:11.231900Z

Did you perform any benchmarks of such solution? I'd be a bit afraid of the fact that you need to spawn new bb instance for every single request (right?). And bbbinary is 70MB..

Tomas Brejla 2021-02-08T10:41:01.232300Z

I mean I like the fact that it's possible to execute bb this way :thumbsup: , I'd just hope that people will not start trying to create full-blown webapps this way πŸ˜„

borkdude 2021-02-08T10:42:23.232800Z

@brdloush I'm not sure if the binary size matter for memory usage. E.g. bb -e '(+ 1 2 3)' give me:

max memory:                17516 MB
You can even set -Xmx as the first command line arg to bb if you are worried about this. For max performance CGI isn't the best solution. You will go to a proper HTTP server (babashka also has one btw) and probably run JVM Clojure. I think you should consider this an experimental approach for personal side projects / low traffic websites.

πŸ‘ 2
Tomas Brejla 2021-02-08T10:47:09.233200Z

Yes, the memory usage will be probably lower than the actual size of the binary. But still, even ~17MB per request is quite a huge overhead (when compared to handling a request in a long-running http server)

Tomas Brejla 2021-02-08T10:47:45.233400Z

yeah, babashka's httpkit server might actually give quite decent performance

Tomas Brejla 2021-02-08T10:51:46.233600Z

still, Eccentric J's solution might be a nice alternative for many personal side-projects, where you need to quickly hack together some http-accessible scripts backed by clojure code and you're not limited by performance. It's nice that you don't have to keep any additional server running -> don't have to monitor its status etc.

2021-02-08T10:53:20.234200Z

Nice @jayzawrotny! I’m curious if you know https://github.com/alekcz/pcp and how you would compare it. I’m guessing your approach fully exploits the features in babashka whereas PCP is based on Sci, but not as fully featured as Babashka. PCP might counter the memory issues @brdloush mentioned

borkdude 2021-02-08T10:56:14.236800Z

From the blog post: > Github user alekcz (Alexander Oloo) has begun drafting PCP: A Clojure processor that runs a SCGI server that can act as a replacement for a long-running php-fpm process. This may not be best suited for a shared hosting service but would definitely be good for a VPS hosting service. I look forward to seeing it progress! Afaik PCP also needs a JVM to run.

2021-02-08T10:57:29.238200Z

Yeah good point. Different approach then. Nice to see these developments anyway

2021-02-08T10:58:32.240300Z

Yes found it the other day and linked to PCP in my article as an alternative. This solution with bb works with SimpleCGI. Where the script runs cold. PCP is more like FastCGI where there is a continuous process that a request client communicates with like how php-fpm works. You cannot run PCP on shared hosts, you will need at least a VPS.

2021-02-08T11:00:32.241800Z

Thanks for the explanation! And thanks for exploring this use of Babashka!

πŸ‘ 2
1
2021-02-08T11:03:17.245100Z

Next step is to convince the php hoster companies to make babashka available on their servers πŸ™‚ (I forgot the name for these companies πŸ™ˆ)

2021-02-08T11:07:16.248500Z

@brdloush I did not benchmark it but I doubt it would be reliable. Shared hosts are unpredictable, like a bathroom shared amongst many roommates πŸ˜‚ While editing it I probably refreshed the page in the triple digits and it certainly wasn’t the fastest but it’s loading < 1 s for me which is sufficient given that I’m loading bb, Postgres pod, running a query, transforming css with gaka, and html with hiccup. I wouldn’t launch an enterprise, high-availability service with it but it seems very promising for putting together some MVPs.

2021-02-08T11:08:23.250400Z

The setup I am using for now is also the least optimized, might be a bit more performant to uberscript the entire project and run it through that as a single bundle and use carve to trim it down.

borkdude 2021-02-08T11:09:47.250700Z

And then when you want to optimize it even further you can GraalVM compile it without using bb, or just produce static HTML for pages that don't need user input (if you want to continue going the CGI route)

🀘 1
Tomas Brejla 2021-02-08T11:16:55.251200Z

> I did not benchmark it but I doubt it would be reliable. Shared hosts are unpredictable, Agreed. But one can still perform such benchmark on his local machine. Maybe someone will try it. It's not that important to do such benchmark. I was just curious, as I have no idea (nor a good estimate) of how poorly (or perhaps surprisingly well) this hacky-but-nice solution would scale. Maybe I'll try to benchmark this myself if I find some spare time.

2021-02-08T16:49:57.256100Z

That would be great! I’d be interested in seeing how it’s done for the future.

borkdude 2021-02-08T16:50:48.256300Z

I usually use multitime to test multiple invocations of a script

borkdude 2021-02-08T16:51:51.257200Z

e.g.:

$ multitime -n10 -s0 /usr/local/bin/bb tmp/meander.clj
===&gt; multitime results
1: /usr/local/bin/bb tmp/meander.clj
            Mean        Std.Dev.    Min         Median      Max
real        0.152       0.004       0.148       0.151       0.159
user        0.108       0.002       0.106       0.107       0.110
sys         0.041       0.002       0.037       0.040       0.045

2021-02-08T16:52:05.257700Z

I see so create a script that creates a request and waits for a response then run it with multitime?

borkdude 2021-02-08T16:52:39.257900Z

I think you should just test the script itself preferably

borkdude 2021-02-08T16:53:08.258300Z

and not include other tools, to discount their startup time overhead

2021-02-08T16:55:25.258800Z

Good point

kschltz 2021-02-08T16:55:41.259Z

btw, Just loved to see Igorrr referenced in front page

val_waeselynck 2021-02-08T17:54:01.259600Z

@jayzawrotny I love this stuff. I've been really bothered by the infrastructure footprint of keeping live Clojure runtimes online, and this approach looks very promising.

Shantanu Kumar 2021-02-08T18:35:10.260Z

Could this idea be extended to run serverless scripts using bb?

borkdude 2021-02-08T18:37:50.260200Z

@kumarshantanu You mean like AWS Lambda-ish?

Shantanu Kumar 2021-02-08T18:38:53.260400Z

Yes, @borkdude

borkdude 2021-02-08T18:41:05.260600Z

@kumarshantanu I've seen several mentions of babashka on AWS Lambda. I think it works. There's also a blog post about it here: https://www.jocas.lt/blog/post/babashka-aws-lambda/ @dainius.jocas I think it's the first time I see this blog post. Here is a specific setting for AWS Lambda: https://github.com/babashka/babashka#package-babashka-script-as-a-aws-lambda

1
borkdude 2021-02-08T18:41:58.261200Z

The blog approach might need updating, maybe best to discuss in #babashka. People like @lukaszkorecki have mentioned that you can now do this more easily perhaps without "layers".

2021-02-08T18:50:50.261400Z

@schultzkaue πŸ’― I underestimated how difficult it would be to make a meaningful database for this example that demonstrates the power without it becoming overcomplicated. Fortunately I was listening to my Igorrr playlist at the time.

2021-02-08T18:54:35.262200Z

@val_waeselynck I’m glad to hear that! There are many small side projects I can just start busting out now instead of having to plan a whole stack, deploy system, and cloud platform research. It’s amazing how big of a difference removing those decisions make.

Sam Ritchie 2021-02-08T18:58:14.266100Z

Announcing the 0.15.0 release of the #sicmutils computer algebra system for Clojure(script): https://github.com/sicmutils/sicmutils/ SICMUtils is a system built for interactive math and physics explorations in Clojure; it’s also got smoking fast numerical method implementations for when you do want to go fast. The latest release is fully compatible with #sci , and therefore easy to add to any environment (#nextjournal anyone?) that uses SCI for clj(s) evaluation. We’ve also upgraded the automatic differentiation implementation to handle higher order functions, and comparison and equality, so you can differentiate functions with internal conditional. Lots more in the release notes here: https://github.com/sicmutils/sicmutils/releases/tag/v0.15.0 Thanks to @mkvlr, @borkdude and @hcarvalhoaves for your help and contributions in the latest release. Please come say hi in #sicmutils if any of this sounds intriguing!

πŸ‘ 1
πŸ™ 4
πŸš€ 9
πŸŽ‰ 3