Fork me on GitHub
#beginners
<
2023-10-27
>
pmros08:10:38

I cant remember a cli tool for passing shell output to clojurescript code (something like nbb). Can you help me?

seancorfield16:10:54

Please don't cross-post questions into multiple channels -- you posted this in at least three channels so answers get spread out everywhere and people in one channel don't know whether you've already gotten an answer elsewhere.

λ18:10:17

Is there a channel for finding a mentor or a buddy to pair program with?

λ18:10:36

IF there's any beginners here that would like to connect let me know I am also learning Clojure and have a very basic IRC bot project that I am working on

seancorfield18:10:28

#C3APA2B6W but I suspect that's fairly quiet...?

λ18:10:39

Thank you Sean,!

λ20:10:57

I suppose I am going from practice to practitioner currently & that involves modelling solutions to problems I am working on an IRC bot that involves implementing client functionality. I am wrapping my head around modelling this problem domain in a way that makes sense. IRC has messages, as we all know, and these have a known format, as you’d expect The format is as such: https://modern.ircdocs.horse/#message-format I aim to parse these messages (obviously), but what is the best way to do so? Would (defrecord) be helpful here? That would result in many instances of messages, which doesn’t sound like what I want, but is it the way that chat applications are approached and designed? :man-shrugging: P.S. I just picked up a copy of Clojure Applied by @alexmiller and would appreciate any other resources to supplement this journey to mastery!

dpsutton20:10:44

i’ve seen lots of cool projects that end up doing lots of complicated stuff by just starting. make a function that parses what you need. let your needs drive what you need from the parser. analysis paralysis when you are trying to learn can lead to stalled projects. start making what you need. as it evolves, keep reading about parsers to see if there’s some theory that could help you. But don’t wait for a beautiful design before you jump in

💙 1
2
seancorfield20:10:09

One thing to be aware of with Clojure Applied: it leans heavily on records to model domain entities but the author (Alex) has said that if a "next edition" happens, he would emphasize plain old hash maps more and records less. So don't reach for records unless you actually need them.

☝️ 1
til 2
Nundrum20:10:20

I've found that Instaparse is magic for things like this.

👀 1
λ20:10:25

Hey Sean, thanks for clearing that part up; I was discussing with the folks in #C03S1KBA2 on Libera.chat , and this also came up.

dpsutton20:10:10

also, a side benefit of just jumping in is that your questions get much more grounded. And the more concrete the question the better help you’ll get here

2
λ20:10:18

@U02UHTG2YH5 now that seems like a fun and interesting way to go about doing this

λ20:10:38

Albeit these are quite simple messages to straight up parse

λ20:10:41

@U04V70XH6 should I even bother with reading this book then?

dpsutton20:10:47

in some domains you can get by with just regex. in fact, @U064J0EFR made a parser for clojure code with regex that didn’t break down until like 800 character forms

seancorfield20:10:22

The book is great. Just substitute "hash map" for "record" in your mind while reading those sections 🙂

λ20:10:34

Very well then

λ20:10:45

Off I go down another days worth of Clojure rabbit holes

λ20:10:32

… can’t I just return a map from a record though?

seancorfield20:10:01

Just use hash maps. Ignore records altogether for now.

1
seancorfield20:10:25

A record is-a hash map but with some additional constraints.