Fork me on GitHub
#lumo
<
2017-05-18
>
richiardiandrea01:05:05

@mfikes I was playing with abio and wondering what is the status...

anmonteiro01:05:49

@richiardiandrea not to be used yet I believe

anmonteiro01:05:00

the goal is to include it in Lumo & Planck eventually

richiardiandrea01:05:35

well I have tried in lumo exactly, it works but it is not deployed on clojars that is why I was wondering 😄

mfikes01:05:11

Right... it is more or less of the start of an idea, but it hasn't been pushed very far yet

erichmond03:05:18

are there any good examplse of using lumo for shell scripting, for example?

erichmond03:05:25

Is it’s core just cljs core?

anmonteiro03:05:43

there are a few bundled libraries with Lumo but no docs yet

anmonteiro03:05:45

working on it…

erichmond03:05:37

thanks! It’s a ton of work, I understand. Just thankful you’re working on such great stuff 🙂

erichmond03:05:18

would it maybe be easier to just hook into node’s child_process if I need to execute binary exes?

pesterhazy08:05:45

@anmonteiro is there a list of bundled libraries?

pesterhazy08:05:06

actually I've been thinking about lumo for shell scripting, and it seems to be post a dilemma

pesterhazy08:05:49

You can use the sync versions of functions (e.g. spawnSync). That's great for shell scripting, but you miss out on the bulk of functionality of node.

pesterhazy08:05:38

If you want to use any but a few functions from the stdlib, you can use the (universally preferred) async versions. However, shell scripts are by their nature synchronous, an imperative sequence of commands to follow. So you risk using a programming style (callbacks, promises, core.async) that is more appropriate for network programming, with little advantage for the use case.

pesterhazy08:05:43

Both horns of the dilemma are probably viable. Picking the first option would turn node into a much less rich platform, basically reduced to reading files and spawning processes, but it would resemble a conventional shell like bash more.

pesterhazy08:05:16

Going the second route could work as well. Ideally we could come up with some kind of DSL that makes the async system less of a pain for this type of use case. That abstraction would make simple scripts as convenient as bash scripts, but I'm worried that the abstraction would leak through once you turn to more advanced use cases (conditionals, loops, pipes...).

richiardiandrea16:05:01

@pesterhazy I have always found that the best async abstraction, if you want to compose, is channels..that is why piping works so well in bash, basically every process "exposes" a channel. Of course this needs to take advantage of the underlying OS stuff...I don't think it is something solvable in lumo itself...probably piping edn in and out is a good idea...maybe a switch can select a function (`-d my-ns.decoder`) that does the conversion from the input to something clojurescript can understand

pesterhazy16:05:45

@richiardiandrea I'm not sure I'm buying the usefulness of channels here. Essentially bash scripts have sequential form "cmd1; cmd2, cmd3". I think it makes sense to think about scripting in terms of this simple use case first, and add advanced concepts -- even pipes -- later.

pesterhazy16:05:19

How does the concept of a channel help capturing such a sequential process?

richiardiandrea16:05:34

yeah forget about channels, I was probably thinking more about piping

richiardiandrea16:05:08

the concept of pipe and channels is related...not that useful in this case

pesterhazy16:05:36

yeah, node streams give you a pipe functionality, so that could actually be a useful building block

richiardiandrea16:05:50

so the problems I see here then are two: task concatenation/abstraction(?) ... if data is coming not in edn, the conversion to cljs data structures

richiardiandrea16:05:40

and again, I wish my Google Summer Of Code idea of porting boot to lumo had been accepted 😄

dominicm16:05:38

Now it'll have to be mach ;)

richiardiandrea16:05:39

Yes that is my go to option for new-ish things 😄