This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-18
Channels
- # announcements (2)
- # architecture (10)
- # beginners (51)
- # cider (14)
- # cljsrn (1)
- # clojure (13)
- # clojure-uk (3)
- # clojurescript (63)
- # cursive (1)
- # datomic (8)
- # emacs (1)
- # figwheel (1)
- # figwheel-main (18)
- # fulcro (62)
- # hyperfiddle (1)
- # incanter (1)
- # jobs-discuss (4)
- # off-topic (3)
- # parinfer (6)
- # reagent (5)
- # ring-swagger (3)
- # shadow-cljs (25)
- # sql (2)
- # tools-deps (2)
@chad I opened an issue on CIDER to enhance this javadoc support. https://github.com/clojure-emacs/cider/issues/2406
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
Thank you as always!
Do you have a patreon account or something? I'd like to be able to buy you a coffee once in a while
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
You're the man
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
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
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. https://www.youtube.com/watch?v=cPNkH-7PRTk
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.
There is a transcript of both parts here: https://github.com/matthiasn/talk-transcripts/blob/master/Hickey_Rich/ClojureIntroForLispProgrammers.md
Just added that link as a comment to the YouTube video
It might depend upon which browser is used, perhaps? What are you using, sundarj?
FYI, transcripts for many of Rich Hickey's talks are available here, inside the same git repo linked above: https://github.com/matthiasn/talk-transcripts/tree/master/Hickey_Rich
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.
gotcha, thanks @andy.fingerhut
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.
> It is not an error to shadow the name, as long as you do not want to use the name that has been shadowed.
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.
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
(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.
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: https://github.com/bbatsov/clojure-style-guide#dont-shadow-clojure-core