Fork me on GitHub
#babashka
<
2019-10-06
>
plexus02:10:12

@borkdude I would be more interested to see a list of what is not (yet) supported, and other general limitations

borkdude06:10:48

Can you name a few examples of what would be needed for scripting thatโ€™s currently not possible? Iโ€™d be happy to add them to the README

plexus10:10:00

I don't know because I don't know what isn't supported :)

borkdude10:10:49

Good point. But maybe it's good to start with the expectations you might have of such a tool.

borkdude10:10:21

I have read through the joker README and they mainly describe the difference in data types (int, float, etc). In that regard babashka is exactly the same as normal Clojure. It also supports multi-threading (unlike joker) because where it can, it just proxies through to "normal Clojure".

borkdude10:10:24

If there are any functions missing, it's fairly trivial to add them. But using libraries from maven is not something that is supported. Also creating namespaces isn't supported. And the ns macro isn't. You can use require but only to alias namespaces that are already present.

borkdude10:10:00

There is load-file to load external files though.

borkdude10:10:52

Java interop is "faked" by creating functions named File. and so on which proxy through.

borkdude10:10:48

I think that mostly covers it.

borkdude10:10:03

And there might be some macros missing, but I believe the most important ones are in there now.

plexus10:10:48

So every function from clojure.core is implemented in sci?

borkdude10:10:24

not all functions are mapped in sci, for example println is not, but a lot of them are additionally mapped in babashka yes.

borkdude10:10:01

sci is the library and "no side effects" is the default in sci

plexus11:10:06

there are no vars as such, right?

borkdude11:10:18

right, it's more like names directly mapping to values, as you get with direct linking

borkdude11:10:51

but you can re-define vars

borkdude11:10:03

like (def x 1) (def x 2)

borkdude09:10:39

sci (which powers babashka) is on the front page of HN. https://news.ycombinator.com/

sogaiu09:10:00

better get a logo soon ๐Ÿ™‚

borkdude09:10:38

Maybe I should ask Nikita again

borkdude09:10:55

Who makes the logo for CIDER and Calva btw?

borkdude10:10:04

Oh thanks. If Nikitonsky doesn't want to do it, I'll try him.

sogaiu10:10:28

i didn't have any success on figuring out the origin of calva's, but perhaps if it's necessary, PEZ can be queried for a definitive response.

borkdude10:10:56

I think it was the same person as CIDER, but could be wrong

plexus11:10:10

I was trying some things out in a babashka socket-repl, (meta {}) and (with-meta {} {:foo :bar}) both cause an endless stream of bb=> Unmatched delimiter: ) [at line 1, column 9]

plexus11:10:28

bb '(println {})'
clojure.lang.ArityException: Wrong number of args (0) passed to: clojure.core/distinct?

borkdude11:10:59

eeeeh yes, that's a bug in edamame which was fixed this week.

borkdude11:10:15

sorry about that. I will have to release a new version of bb for this. thanks for the reminder

borkdude11:10:32

the bug was that (apply distinct? []) doesn't work ๐Ÿ˜•

borkdude11:10:40

I'll release one now

plexus11:10:02

thanks ๐Ÿ™‚

plexus11:10:17

how about the meta stuff? I was trying to check if metadata is supposed to work or not...

borkdude11:10:03

I think with-meta and vary-meta aren't in sci yet. I'll also add those.

borkdude11:10:12

after that it should work

borkdude11:10:36

@plexus I think this should already work in the "old" bb: (meta (vary-meta {:a 1} #(assoc % :foo 1)))

borkdude11:10:42

I only forgot to add with-meta for some reason.

plexus11:10:14

ah yes, that works!

borkdude11:10:20

bb v0.0.20 released

borkdude11:10:26

Nice, thanks for the PR!

borkdude11:10:10

I'll probably change a few words here and there but overall it's a pretty good summary

borkdude11:10:56

@plexus With bb 0.0.20:

$ bb '(meta (with-meta {} {:foo :bar}))'
{:foo :bar}

plexus11:10:25

Yeah please do with it what you like :) it's just a starting point