Fork me on GitHub

@chad I opened an issue on CIDER to enhance this javadoc support.

Logan Powell16:08:19

So, I'm running into the limits of my js VM (using a bunch of js interop that requires sequential operations between multiple fs async calls) and I'm hitting this error:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node_module_register
 2: v8::internal::FatalProcessOutOfMemory
 3: v8::internal::FatalProcessOutOfMemory
 4: v8::internal::Factory::NewFillerObject
 5: v8::internal::wasm::WasmOpcodes::TrapReasonMessage
 6: 000002033BF843C1
I'm thinking I need to digest this work into smaller bites, i.e., instead of trying to run 1000 concurrent fs reads/writes, break it up into smaller batches so as not to exhaust the available RAM. Is there a best-practice for "waiting" inside a function on a batch of work to be done before kicking off the process on the next batch?


N looping workers consuming from the queue of input data


each worker could be a core.async go block, read from queue, async op, read from queue etc., start as many as your process can safely handle

Logan Powell19:08:28

Thank you as always!

Logan Powell19:08:13

Do you have a patreon account or something? I'd like to be able to buy you a coffee once in a while

Logan Powell19:08:39

Also, when you say "N looping workers", do you mean like (go-loop...?


go-loop makes one worker, so (doseq [etc. etc.] (go-loop ....)) yeah

Logan Powell20:08:04

You're the man

Logan Powell20:08:35

Dude, it took me a while to get all the shit figured out, but your approach worked like a goddamn charm! Thank you so much


it's what's worked for me in the past


oh and I finally noticed the thing you said about patreon - I work in fintech, you really don't need to worry about me having money :D

Logan Powell20:08:44

haha of course you do! πŸ™ anyway


when the revolution comes you can inform the people with the guillotines I'm one of the good ones

Logan Powell20:08:39

vive la resistance


Anyone with some recommendations on good reads about WHEN to use datomic? Is it still very expensive?


Turns out this video is broken at about 6 minutes in.


"Clojure for Lisp programmers, part 1" by Rich


I've tried using VLC to stream it, tried downloading it, still broken. Using mplayer, the video will continue, but the audio just drops out after ~6 minutes.


Using youtube-dl to download a few different versions of the audio track and see if I can find a working one.


(Really interested in seeing this, because Part 2 was great!)


Just added that link as a comment to the YouTube video


fwiw, the video works fine for me


@sundarj can you seek to, say, 10 minutes in and still hear audio?


then there is hope yet! perhaps your youtube client is streaming a different encoding.


i'm just using the website


It might depend upon which browser is used, perhaps? What are you using, sundarj?


vivaldi, which uses chrome's engine


works in chrome as well for me


FYI, transcripts for many of Rich Hickey's talks are available here, inside the same git repo linked above:

Michael Stokley23:08:10

is there a naming convention to avoid shadowing? for example, in python, they append a trailing underscore


You mean, if you want a local function parameter name or a name bound by a let expression that would otherwise match a widely used name like key or map?


It is not conventional in Clojure to append a trailing underscore, that I have seen. It is conventional to pick a different name for the parameter or locally bound name, if you want to avoid the shadowing, e.g. use m instead of map, or k instead of key.


It is not an error to shadow the name, as long as you do not want to use the name that has been shadowed.


The eastwood Clojure lint tool will warn if you create a local name that shadows a function name, and then try to call that name as a function. It does not warn on all occurrences of shadowing, though, since sometimes people do shadow and don't try calling the shadowed function.

Michael Stokley23:08:37

> It is not an error to shadow the name, as long as you do not want to use the name that has been shadowed.

Michael Stokley23:08:52

would you say clojure / lisp is unique in having this rule?


I may not have been very clear in my statement there. It isn't a compiler error in Python to shadow a name, I don't think. It isn't a compiler error in Clojure/lisps, either, but I don't think they are unique in this.


It is a functional error in your code if you shadow a name, and then try to use the shadowed name's original value. Not a compiler error, though.

Michael Stokley23:08:52

makes sense. i think i may have been unclear. πŸ™‚ i'm under the impression that in some contexts / communities, shadowing is always considered bad practice. i was wondering if clojure stood out in that regard

Michael Stokley23:08:29

(i could easily be mistaken, of course)


I mean, if you have a simple 3-line function definition that uses a parameter named map, and do not call the function map anywhere in there, sure you are open to the possible future problem that if you change the definition to then try to call clojure.core/map as just the name map, you've introduced a bug. Will people warn you about this and recommend a different parameter name if you are a beginner? Probably. Will people file bug reports against an experienced developer's open source project for doing that? Probably not.

βž• 4
πŸ‘ 4

some think it's fine, others think it should be avoided. it's really up to you


I would bet that there are some teams of Clojure coders in private companies that always consider it a bad practice, via their own internal coding styles, and file bugs against each other if they violate it.


the community style guide (which is opinionated, but is often idiomatic) has this to say:

πŸ‘ 12