Fork me on GitHub
#clojurescript
<
2019-08-06
>
Gabriel01:08:23

@dnolen I wasnt complaining about the perf being bad, I just didnt expected such variation between optimization levels, that's my point. Anyway, upgrading node solved the problem and thus the problem wasnt in clojurescript itself.

dnolen01:08:57

Right we test multiple VMs to check for these kinds of oddities

dnolen01:08:43

Also you have to careful often with micro benchmarks like that you aren’t measuring anything

dnolen01:08:59

That is really good numbers mean nothing is happening

Gabriel01:08:02

My company currently uses javascript/node.js and we're evaluation options, we'd like to see languages that compile down to javascript and migrate our codebase. Reason, ClojureScript, Fable etc

Gabriel01:08:05

and predictability is a very very important feature, we don't want surprises in production hehe

dnolen01:08:26

those are very different options

dnolen01:08:41

and I don't know what predictability means w/ modern VM architectures

dnolen01:08:53

in the end it's JS and JS VM stuff applies

dnolen01:08:48

and also all of them are different

dnolen01:08:05

anybody that says that they can play around all the VMs is not telling the truth

dnolen01:08:44

when we started V8 was the fastest - now JSC is the fastest

dnolen01:08:53

and Spidermonkey is no longer awful

dnolen01:08:35

(if you're mostly doing backend node.js then of course you have less to consider here)

Gabriel01:08:16

Yes, it's basically for aws lambda

Gabriel01:08:54

we use aws lambdas, which are small functions (we try to keep them small hehe)

dnolen01:08:47

then ClojureScript might not be a good fit depending on your perspective on cold start times - Clojurists do it because Clojure and I think people know that cold start while crappy in dev, in production doesn't mean much when you have real load + retry, backoff etc.

Gabriel01:08:35

I didnt want to use clojure (on top of jvm) because of the cold starts and the large use of memory. I was trying to find a way to keep the same behavior we have with javascript (which is very good) but using a "more sane" language.

Gabriel01:08:34

that's how I had the idea of trying out clojurescript etc

dnolen01:08:10

like I said I'm somewhat skeptical about those concerns - but if you're really writing tiny stateless scripts I also don't see why the language choice really matters so much

Gabriel01:08:30

sorry if I sound too naive I'm new to this FaaS thing

dnolen01:08:29

if your goal is to write tiny stateless scripts - probably JavaScript, TypeScript, or Reason are good choices

dnolen01:08:40

you more or less get what you wrote on the JS side

dnolen01:08:03

I'm not sure about Fable's output, but if they do what we do which is a lot of custom data structures then it's not going to be all that small

Gabriel01:08:25

it looks like Fable aims to produce readable javascript, so it's more like Reason

dnolen01:08:44

readable is less important than whether they have a large standard library

dnolen01:08:54

(wrt. to codesize I mean)

dnolen01:08:27

ClojureScript does have a large standard library, almost an incredible amount is just persistent data structure implementation details

dnolen02:08:28

this is why we use Closure Compiler - it takes the standard library down to gzipped jQuery territory

dnolen02:08:50

but that's far cry from a couple of hundrend hand-written JS lines for a Lambda

Gabriel02:08:31

yeah, Fable adds a lot of code because of its stdlib

solf15:08:24

It's crazy, I read a lot about languages that compile about javascript, specially about functional ones, yet it's the first time I heard about Fable. Crazy how many things appear in the js ecosystem

dnolen02:08:03

yeah so this is JS target design space issue - either your thing is just JS w/ some flavor of type-checking w/ some flavor of syntax - or it brings more to the table - the later won't be great for tiny scripts - and we're on that end of spectrum because just believe there's more value to be delivered there

Gabriel02:08:51

alright it makes sense. clojurescript and fable are super nice but they aren't the right tool for what i need to build.

lilactown04:08:27

with Reason, it’s even a bit more complex; there are multiple standard libs to choose from, plus the runtime (immutable data and other things)

Santiago14:08:42

hey! I’ve never done anything in clojurescript, only toyed around with clojure. I want to make a static website that allows someone to upload a file to my google drive, basically a form. any recommendations about where to start? libraries etc

dnolen14:08:01

just use ClojureScript

dnolen14:08:12

you should able to do that w/o any third party things

dnolen14:08:44

ClojureScript includes Google Closure Library which has a bunch of the typical browser libs you need

Santiago15:08:30

ah nice! I’ll check that lib, sounds promising 😄 thanks!

Chris16:08:04

Has anyone had and success/failure/luck with using the AWS Amplify Library in ClojureScript?

thheller16:08:59

pretty old but maybe still works?

Chris17:08:51

Thanks, will give it a shot!

ivana21:08:03

Hello! How can I get a success?

(str/replace
   "a--
--b"
   #"(?s)a.*b"
   "success")

dpsutton22:08:39

(str/replace "a-\n-b" #"a[\s\S]*b" "success")

👍 4
dpsutton22:08:19

the gist is to specify all whitespace characters and all non-whitespace characters

ivana22:08:24

hm... I see

DON'T use (.|[\r\n]) instead of . for multiline matching.
DO use [\s\S] instead of . for multiline matching
so I think the suggestion in to USE dot-all modifier. And it works on re-match, but not in replace

dpsutton22:08:10

its saying to use [\s\S]* as my example there, right?

ivana22:08:47

oh, now I see, sorry and thanks!

dpsutton22:08:49

it seems js allows for [^] (complement of empty-set) but cljs doesn't like this. "Unclosed character class ..."

dpsutton22:08:23

yeah it was a bit awkwardly phrased but i think the \s\S is what they recommend

ivana22:08:41

I tried and it works! Thanks again