ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.2 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
<FromGitter> <codenoid> only for bot api http://crystalshards.xyz/?filter=telegram
moei has joined #crystal-lang
Philpax has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
<jokke> hey
<jokke> what was the repo with the perfomance comparisons between languages including crystal?
rohitpaulk has quit [Ping timeout: 264 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <girng> @codenoid lol
frog has quit [Ping timeout: 276 seconds]
commavir has quit [Ping timeout: 255 seconds]
commavir has joined #crystal-lang
greenbigfrog has joined #crystal-lang
commavir has quit [Ping timeout: 240 seconds]
greenbigfrog has quit [Remote host closed the connection]
commavir has joined #crystal-lang
commavir has quit [Ping timeout: 260 seconds]
commavir has joined #crystal-lang
commavir has quit [Ping timeout: 276 seconds]
commavir has joined #crystal-lang
commavir has quit [Ping timeout: 240 seconds]
commavir has joined #crystal-lang
<FromGitter> <forkev_twitter> https://github.com/kostya/benchmarks ?
greenbigfrog has joined #crystal-lang
thews has quit [Ping timeout: 264 seconds]
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
<FromGitter> <bararchy> @alex-kampa check out SushiChain , its a block-chain framework in Crystal
Ven`` has joined #crystal-lang
Ven`` has quit [Ping timeout: 248 seconds]
Ven`` has joined #crystal-lang
Ven`` has quit [Client Quit]
Ven`` has joined #crystal-lang
Ven` has joined #crystal-lang
Ven`` has quit [Read error: Connection reset by peer]
alex`` has joined #crystal-lang
Ven` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Raimondii has joined #crystal-lang
mitch has joined #crystal-lang
Raimondi has quit [Ping timeout: 264 seconds]
Raimondii is now known as Raimondi
mitch has quit [Quit: Page closed]
Ven`` has joined #crystal-lang
<FromGitter> <alex-kampa> @bararchy thanks for the suggestion re SushiChain, there may be a couple of useful elements for us there. Sikoba z-nodes is not a typical blockchain project though, this will be a generic state machine replication architecture with pluggable consensus, with blockchain only used to ensure immutability of history. A bit like Tendermint, but with some additional features.
<FromGitter> <bararchy> @alex-kampa sounds interesting, what real world use cases would this project handle? What unique features are you planning ? :)
thews has joined #crystal-lang
thews has joined #crystal-lang
thews has quit [Changing host]
<FromGitter> <ok2094> Does crystal allow inheritance of multiple classes?
<RX14> no
<RX14> you probably want modules
<FromGitter> <alex-kampa> @bararchy - we are doing this for a project called "sikoba" (cf https://www.reddit.com/r/sikoba/wiki/docs) for which we have not found a suitable platform - projects like Tendermint and Babble come close, but do not have all the features we need. And we think our approach could be useful for other consortium blockchain projects.
<FromGitter> <alex-kampa> The two unique features will be 1) initial user access without private key or wallet, removing a significant hurdle for product adoption 2) pluggable consensus, allowing to even have different consensus mechanisms for different functions during each block cycle.
<FromGitter> <alex-kampa> The latter we need for something I call "optimisation consensus protocol", where the nodes compete by each working independently on a (useful) hard-to-solve problem for a limited period of time.
<FromGitter> <alex-kampa> This requires several different consensus rounds before producing a single block.
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Philpax has joined #crystal-lang
greenbigfrog has quit [Ping timeout: 255 seconds]
IMnotARobot has joined #crystal-lang
<IMnotARobot> hey
IMnotARobot has quit [Client Quit]
commavir has quit [Ping timeout: 255 seconds]
commavir has joined #crystal-lang
commavir has quit [Ping timeout: 255 seconds]
commavir has joined #crystal-lang
greenbigfrog has joined #crystal-lang
commavir has quit [Ping timeout: 255 seconds]
commavir has joined #crystal-lang
<hightower2> I have the following problem: if I define property x : Array(Type1) , and I later do obj.x = [ type1 objects... ], all is good and works without me specifying the type of []. But if I just extend that to property x : Array(Type1 | Type2), suddenly I can no longer write obj.x= [ type1 objects ] because the compiler complains: instance variable '@x' must be Array(Type1 | Type2), not Array(Type1)
<hightower2> Is there a way to avoid this?
greenbigfrog has quit [Ping timeout: 256 seconds]
<FromGitter> <gdotdesign> this is a workaround I think `obj.x = [type1 objects] of Type1 | Type2`
<FromGitter> <gdotdesign> I had the same problem with hashes a while back
commavir has quit [Ping timeout: 256 seconds]
commavir has joined #crystal-lang
<hightower2> Yes, yes, my problem is exactly that I want to avoid having to write "of Type1 | Type2" at every places where I assign to x
<hightower2> It is strange that for one type, it doesn't require it, but for multiple types it does, even though the arguments are clearly implicitly castable into defined type(s)
commavir has quit [Ping timeout: 260 seconds]
Ven`` has joined #crystal-lang
commavir has joined #crystal-lang
<FromGitter> <yxhuvud> Hmm. I wonder if that behavior will change when the literal automatic type conversion changes is released.
commavir has quit [Ping timeout: 265 seconds]
<hightower2> I'm aware of that PR but somehow thought it doesn't affect this case specifically. It's worth trying out, though.
<oprypin> yxhuvud, the changes are all merged to master
<oprypin> and they will not make this better
<oprypin> in fact, a different change made it slightly "worse"
<oprypin> because there were some cases where what you wrote might even work under some circumstances but that's mostly accidental
<oprypin> you do have to write `of`, that's the best right now
<oprypin> maybe the literal-related changes could pave the way towards improving this but i wouldn't hold my breath
<hightower2> ahh... ok, thanks
<oprypin> oops wrong tag i guess
<hightower2> I am going to try to avoid the problem by pushing to an array rather than replacing it
<hightower2> So instead of doing x = [1,2,3] of T1 | T2, I am just going to do x<< [1,2,3]
<hightower2> This will help in at least part of the cases where this is bugging me now
Ven`` has quit [Read error: Connection reset by peer]
Ven` has joined #crystal-lang
<RX14> planning on streaming to try out my parallelism ideas today
duane_ has quit [Ping timeout: 255 seconds]
commavir has joined #crystal-lang
<Vexatos> Nice.
greenbigfrog has joined #crystal-lang
Ven` has quit [Ping timeout: 276 seconds]
Ven`` has joined #crystal-lang
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jeromegn> RX14: where do you stream? Would love to watch.
<RX14> Twitch
<jeromegn> same username?
<RX14> yeah
<livcd> when ? :)
<RX14> sometime after lunch
<livcd> UK time i assume ?
<RX14> more like my stomach time
Ven`` has joined #crystal-lang
duane has joined #crystal-lang
Ven`` has quit [Read error: No route to host]
Ven`` has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
faustinoaq has joined #crystal-lang
Ven`` has joined #crystal-lang
Ven`` has quit [Client Quit]
Philpax has quit [Ping timeout: 276 seconds]
snsei has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
woodruffw has quit [Excess Flood]
woodruffw has joined #crystal-lang
woodruffw has joined #crystal-lang
woodruffw has quit [Changing host]
<FromGitter> <ryankshah> How can I just get the header information from a CSV file without reading it all in?
<FromGitter> <drujensen> I think this works: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5afae84a8c24fe61eae80e3d]
Ven`` has joined #crystal-lang
<FromGitter> <ryankshah> @drujensen that still reads the entire CSV though right?
<z64> @ryankshah, no - it just instantiates a Parser and reads the headers; https://github.com/crystal-lang/crystal/blob/4f9ed8d03208dd0db33993c5a6fa6753bc1cf91e/src/csv.cr#L155-L166
<FromGitter> <ryankshah> @z64 Thanks for the clarification :)
<FromGitter> <ryankshah> what type would `headers` be?
<z64> Array(String)
<FromGitter> <ryankshah> And finally, does `File.read` read the contents of the file into `raw`?
<z64> not sure what you mean by `raw`. File.read returns a String of the files contents
<FromGitter> <ryankshah> The thing is, my files will be extremely large and I only need the headers because I will perform operations on the data of the csv line-by-line
<z64> right. which is why you pass CSV.new an IO
<z64> (dont use File.read)
<FromGitter> <ryankshah> How could I use an IO in this case?
<z64> i.e. `File.open("data.csv", "r") { |file_io| CSV.new(file_io...) }`
<FromGitter> <ryankshah> Is there a place where I can check the syntax for that?
<FromGitter> <ryankshah> I can't find it in File in docs
<FromGitter> <ryankshah> wait
<FromGitter> <ryankshah> My undergrad java { \n } block kicked in, it has to be on one line
<z64> o
<FromGitter> <ryankshah> rip
<z64> what were you confused about though? the block syntax? `foo { |var| ... }`?
<FromGitter> <ryankshah> No the syntax is not confusing at all, my brain is fried from submitting my PhD application and my brain reverted to OOP code style and i wrote it like this: ⏎ ⏎ ```File.open("data.csv") { ⏎ |io| ... ⏎ }``` [https://gitter.im/crystal-lang/crystal?at=5afaef5841f54f22e22f367e]
<z64> oh okay
<FromGitter> <ryankshah> Thanks for the help though!
<z64> if you're doing multiline block though, you should use `do..end` instead
<z64> no problem
<FromGitter> <ryankshah> I'll keep that in mind, but the single line block should be suffice
<z64> yep
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
snsei has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
<RX14> probably stream in 25 mins
<FromGitter> <bew> I'll be there ;)
rohitpaulk has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
snsei_ has quit [Ping timeout: 276 seconds]
<FromGitter> <fridgerator> LOL, i kept hearing sounds coming from my computer and couldnt figure out what it was
<FromGitter> <fridgerator> your twitch link started auto-playing
<FromGitter> <ryankshah> LOL
<FromGitter> <ryankshah> same here
<FromGitter> <ryankshah> i thought I was going mad
<FromGitter> <fridgerator> why in the F am I hearing keyboard clicking noises and talking
<FromGitter> <fridgerator> 😆
<FromGitter> <bew> This way you can't miss it ^^
<FromGitter> <ryankshah> xD
<FromGitter> <ryankshah> @RX14 taking the promotion of the language to new extremes
<RX14> it shouldn't auto play
<Vexatos> Thanks gitter
alex`` has quit [Ping timeout: 260 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
<f1refly> Is there a way to launch a terminal editor ($EDITOR) from my crystal program and wait for it to close? I played around with the Process class but couldn't figure it out
<f1refly> Is there documentation about this somewhere? I think about something git-esque
hmans has joined #crystal-lang
<hmans> \o/
<FromGitter> <hmans> \o/
<jsn-> f1refly, system(), as usual
snsei has joined #crystal-lang
<FromGitter> <LVMBDV> which pastebin should i use for crystal code?
<Vexatos> https://carc.in/#/cr is nice
<FromGitter> <LVMBDV> ah yes thanks
<FromGitter> <LVMBDV> i had seen it but i couldnt remember the name
<FromGitter> <LVMBDV> so, i have a problem with TypeNode.instance_vars
<FromGitter> <LVMBDV> https://carc.in/#/r/42oy
snsei has quit [Ping timeout: 276 seconds]
<FromGitter> <LVMBDV> i expect it to return an array of MetaVars but it doesn't, maybe that information isn't available at compile-time (when macros are run?)
<FromGitter> <bew> it works when inside of a method https://carc.in/#/r/42p1
<FromGitter> <LVMBDV> weird, any ideas why?
<FromGitter> <bew> yeah, it's a bit tricky
<FromGitter> <bew> macros in methods are expanded after the compiler typed everything
<FromGitter> <LVMBDV> how about macros in methods defined in macro methods?
<FromGitter> <bew> macros in top level could still creates new types, add new instances vars to types, so there is no reliable way to get the instance vars until the compiler typed things
<FromGitter> <bew> you can't have a method in a macro method, the macro method is already the method x)
<FromGitter> <bew> but yeah, you can use `TypeNode#instance_vars` from a 'macro method' (a method with some macro in it iirc)
<FromGitter> <LVMBDV> hmm, let me present the tricky part
<FromGitter> <LVMBDV> https://carc.in/#/r/42p5
<FromGitter> <bew> you may want to escape the macros
<FromGitter> <bew> with `\{% ...`
<FromGitter> <bew> so that they will expand in the method, not when `macro included` is called
<FromGitter> <LVMBDV> oh i didn't know that was a thing
<FromGitter> <LVMBDV> i have progress now
<FromGitter> <LVMBDV> thanks @bew :D
<f1refly> jsn-: 'system ${FCEDIT:-${VISUAL:-${EDITOR:-vi}}} #{/path/to/file}' doesn't work for me, it just continues execution
<FromGitter> <LVMBDV> crystal program might not be sharing the (or any) tty with vi when using system()
<FromGitter> <bew> why not?
<FromGitter> <bew> I got `system(ENV["EDITOR"] + " file.cr")` working for me
<f1refly> what editor do you use?
<FromGitter> <bew> it's nvim
<f1refly> thank you, i think i got it now. didn't realize that the Process class was the wrong approach :)
<FromGitter> <bew> why not? `system` is basically calling Process
<oprypin> pls no `system`
<FromGitter> <bew> no idea why this exists in the first place
<oprypin> right?
<faustinoaq> oprypin, is `system` a bad practice?
<oprypin> yes, in every language
<faustinoaq> Why? I mean, I think there is some use cases
<f1refly> what the heck does '`system`' even mean?
<f1refly> can you combine system and backticks somehow?
<oprypin> backticks are the shortcut for the bad practice
<oprypin> so are even worse
<oprypin> the name `system` is coming from C
<f1refly> oh ok, i thought there's an even weirder way of combining them
<oprypin> probably from the same guys who named `cat`
<oprypin> and what the heck does that even mean
<f1refly> i dunno, i just accepted it
<f1refly> and it's short, so there's that
<oprypin> f1refly, oh i probably confused you
<oprypin> those backticks in my message do not mean anything
<oprypin> i'm just basically writing proper Markdown for the enjoyment of Gitter users :|
<f1refly> out of pure interest, how would you launch an editor from inside your program when calling system is bad practice?
<oprypin> Proccess.new([editor, "--", filename])
<f1refly> no problem, i can read it just fine :)
<f1refly> i'll try that, thank you
<FromGitter> <bew> (and use redirect inherit for input, output & error)
<oprypin> if that's not the default, that's pretty bad
<FromGitter> <bew> default is close
<FromGitter> <bew> > <
<FromGitter> <bew> well no, it depends on the use
<f1refly> i've got the whole evening to learn new stuff, will try to get it working
snsei has joined #crystal-lang
DeBot has quit [Quit: Crystal IRC]
jhass has quit [Quit: Bye]
asterite has quit [Quit: Bye]
DeBot has joined #crystal-lang
asterite has joined #crystal-lang
jhass has joined #crystal-lang
<f1refly> oprypin: any idea why this won't compile? https://carc.in/#/r/42q8
<f1refly> without the shell and output arguments it works fine, but is useless to me
<oprypin> f1refly, one day i wanted to make what you just wrote explicitly forbidden
<oprypin> but then i remembered that i cant be bothered to learn the compiler
<f1refly> why tho?
<oprypin> and also people wouldnt accept the change
<oprypin> f1refly, what you wrote: https://carc.in/#/r/42q9
<oprypin> now maybe you can guess what exactly i wanted to forbid
<FromGitter> <bew> what you want is `shell: true` not `shell = true`
* f1refly feels dumb now
<oprypin> it's not you, it's the language
<oprypin> i want to always require parentheses directly around an assignment expression (other than at top level)
<f1refly> i just didn't know that it works that way, the compiler error is kind of confusing in that regard
<oprypin> yes
<oprypin> this kind of "30 buttons" thing is certainly not normal to do so it's entirely possible that there is just no good way to deal with it
<oprypin> oops wrong chat
sagax has joined #crystal-lang
<sagax> hi all!
<FromGitter> <bew> hi, welcome!
<sagax> please, i need some example compiled crystal programs
<sagax> i want check this with "ldd"
<FromGitter> <bew> you can do that yourself, no?
<sagax> if you have already compiled binary file - i will be happy
<sagax> just link to file
<f1refly> sagax, hello there!
<sagax> just i want check that crystal program can be run without external library or some other
<sagax> f1refly: hi!
<oprypin> well it definitely can't be run without external library
<sagax> hm, if it require some system library it's ok to
<f1refly> enjoy
<FromGitter> <bew> what you don't know is that it's a virus that will encrypt all your files, and ask for money x)
<f1refly> it's perfectly fine to run executables from strangers on the internet :>
<f1refly> no seriously it's fine just trust me (tm)
<Vexatos> this is called self-certification, right?
<sagax> f1refly: thanks
<FromGitter> <bew> sagax you could install crystal, and run: ldd /bin/crystal
<f1refly> sagax: no problem, i think i can provide more half baked projects should you need them
<sagax> FromGitter: it's true, just i need check, that compiled binary from crystal can be run on another host without installed crystal
<FromGitter> sagax, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/crystal-lang/crystal
<sagax> sorry, i have very bad english,
<f1refly> oprypin: when i try to launch the editor with Process.new, it comes up for a splitsecond and then vanishes into the background. I can still see it in htop, so it keeps running
<f1refly> sorry if im too annoying
<oprypin> i'm not sure how it's possible for an editor to appear
<oprypin> I don't think you have an executable called "${FCEDIT:-${VISUAL:-${EDITOR:-vi}}}" in your PATH
<oprypin> lol but it actually works for me
<oprypin> and it doesnt disappear
<oprypin> what is even going on
<oprypin> ah of course! shell: true
<oprypin> prefer not to use that if possible
<f1refly> it searches for your preffered editor
<f1refly> and checks all the editor variables
<f1refly> with vi as fallback
<oprypin> yeah that's not the problem
<oprypin> f1refly, do you intend the crystal program to keep running after you started the editor?
<oprypin> do you intend to wait for the editor to finish?
<f1refly> i want it to wait
<f1refly> i saw the wait command obviously
<oprypin> so use `.run` instead of `.new`
<oprypin> that's like new and wait
<oprypin> that should fix igt
<f1refly> god, i wish they'd teach this in school or uni
<f1refly> this ruby syntax is so alien when you didn't learn about it from somebody
<f1refly> do you know if there are sites that do crystal code reviews?
<oprypin> you're on it
<oprypin> ok i think you should be good here. maybe using the shell is a good idea, after all
<f1refly> yes, it doesnt work otherwise
<FromGitter> <bew> Oo why?
<oprypin> because for me I have the editor set to "kate -b" and of course there's no such executable called "kate -b" so we let the shell figure it out
<FromGitter> <bew> ah right
<f1refly> tput works without the shell = true for some reason
<oprypin> well i told you why that thing doesnt work without shell
<oprypin> [21:25:44] <oprypin> I don't think you have an executable called "${FCEDIT:-${VISUAL:-${EDITOR:-vi}}}" in your PATH
<f1refly> yeah, right
<oprypin> here's how i would do it https://carc.in/#/r/42qq
<oprypin> the :inherit trick is only possible in crystal master (not in any release yet)
<oprypin> but applicable otherwise
<f1refly> yes, that looks like a nice solution
Ven`` has joined #crystal-lang
<f1refly> although i think those symbols make it harder to leave
<oprypin> what do you mean?
Ven`` has quit [Ping timeout: 256 seconds]
<f1refly> you put symbols instead of the enums as arguments
<f1refly> i think that's confusing to people who might read it later
<f1refly> i think that's confusing to people who might read it later
<f1refly> sry, wrong button
Ven`` has joined #crystal-lang
Ven`` has quit [Read error: Connection reset by peer]
Ven`` has joined #crystal-lang
<f1refly> oprypin: you've been encredibly helpful for me today, thanks a ton :)
<f1refly> *incredibly
Ven`` has quit [Ping timeout: 260 seconds]
Ven`` has joined #crystal-lang
Ven`` has quit [Ping timeout: 268 seconds]
hightower2 has quit [Remote host closed the connection]
<FromGitter> <fridgerator> neat : https://github.com/RX14/parallel.cr
hightower2 has joined #crystal-lang
<livcd> did RX14 stream about parallelism already ?
<RX14> yeah
<livcd> hmm i am unable to play the video
<RX14> works for me
<livcd> doh!
<livcd> ok now it works
<livcd> my mac goes crazy when I play that video
<oprypin> RX14, surprised to see so much monkey patching!
<RX14> I needed to backport a crystal PR
<oprypin> also surprised that nobody has implemented this before :D
<RX14> lol
<RX14> yeah
<RX14> it needs a lot of work
<RX14> it needs to be able to serialise a lot more and do it fast
<RX14> and eventually the PChan should use shared memory
moei has quit [Quit: Leaving...]
<RX14> and then who knows for locking
<oprypin> RX14, why does read_fully work? wouldn't it sometimes merge together multiple objects?
<RX14> no
<oprypin> uhh ok
<RX14> because we know the size on both sides
<RX14> we always write the same size
<RX14> and always read the same size
<oprypin> ahhh it has sizeof in the read. sorry
<oprypin> it's a bit hard to notice that size there because there is no word `Slice` and also no size specification in the read itself
<oprypin> ok but does this mean that it cant pass even arrays?
<RX14> yes
<oprypin> RX14, but https://github.com/Papierkorb/cannon has serialization
<oprypin> in fact, i wouldnt be surprised if it includes the functionality of your shard, even if it's not advertised
<RX14> this is 3 hours of work on stream
<RX14> so like
<RX14> an hour of work
<oprypin> i always sound overly critical, sorry about that
<RX14> and no it doesn't have the functionality of the shard
<oprypin> it's good stuff, just throwing some ideas
<RX14> serialization is only a part of what needs to be done#
<RX14> for example tying `exit` into exiting *all* the processes together reliably
<oprypin> but wouldnt it be an immediate improvement to just call Cannon ?
<RX14> and the locking *between processes* of the PChan is going to be difficult too
<RX14> oprypin, perhaps
<RX14> I didn't want to spend the stream reading cannon sourcecode
<RX14> it would be boring
<oprypin> i think it would take 5 minutes to try it and i dont see why you'd read source code
<oprypin> that's not even my point though! for future improvement
<RX14> exactly
<RX14> reading canon's readme I think I will use it
<RX14> what I do want though is for the serialization to be automagic
<RX14> also you can make some serious optimizations just by assuming that type IDs are the exact same
<RX14> which canon can't do
<oprypin> i have trust that Papierkorb got as close to automagic as is reasonably possible
<RX14> but you can with parallel because it's always communicating between forks
<RX14> I'm not so sure
<oprypin> btw Cannon does rely on communicating between same versions of Crystal executables, it's not generic
<RX14> i don't think so
<RX14> the data structures have to be the exact same
<oprypin> maybe not to the extent off type idss
<RX14> exactly
<RX14> with canon you can use the same class and it'll work fine
<RX14> with parallel we can assume we can just memcpy() a whole object in-memory
<RX14> also I mean automatic as in not even include a module
<RX14> use any type anywhere without any modification
<RX14> as in monkeypatch serialization into Object so it's always on all types
<RX14> always
snsei has quit [Remote host closed the connection]
<RX14> and even then i'm more concerned about how on earth to do locking in PChan
<RX14> since you have multiple readers and multiple writers in each process
<RX14> so only one fiber between multiple processes can be reading at once
<RX14> and so you'd need something like a pthread mutex
<RX14> but then those are blocking
<RX14> and won't play nice with events
<oprypin> ooh i see the problem now
<oprypin> i was gonna say "just look at what python did"
<RX14> what did python do
<oprypin> but they're fine with blocking so it doesnt matter
<RX14> indeed
<oprypin> but otherwise, python has basically what you described https://docs.python.org/dev/library/multiprocessing.html
<RX14> we'd have to use pthread mutexes with try_lock
<RX14> and then some fuckery with the event loop in case of lock failure
<livcd> is anyone writing https://github.com/frol/completely-unscientific-benchmarks crystal version ?
<RX14> and that sounds ugly
<oprypin> livcd, never heard
<oprypin> sounds like a waste of time to me
<livcd> oprypin: sure this just popped up recently
<livcd> and people were asking for crystal version
<oprypin> RX14, cant you just do locking in a "centralized" manner by having a pipe from each process to the central one?
<oprypin> sending something to a pipe would mean "i want to lock" and central process would receive from 1 pipe when it's ok to proceed
<RX14> oprypin, sounds slow as all heck
<oprypin> serializing objects for IPC is also slow but you gotta make sacrifices
<RX14> eh
<RX14> I wanted to use shared memory for the IPC
<RX14> so it'd just be a few memory copies
<oprypin> maybe you'll get there eventually but this is good for a quick start
<RX14> sure
moei has joined #crystal-lang
snsei has joined #crystal-lang
duane has quit [Ping timeout: 265 seconds]
snsei has quit [Ping timeout: 276 seconds]
DTZUZO_ has quit [Ping timeout: 248 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
DTZUZO has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
<hightower2> I have a problem where a binary download of crystal 0.24.2 just hangs on my machine, whatever I run (e.g. crystal -v, crystal -h, etc.)
<hightower2> This happened on two machines. The first one is ancient, so I thought it's old software. This one now is new
<hightower2> What's funny that while on the first (old) machine 0.24.1, here it exibits the same hanging behavior
<hightower2> meant to say, on the first (old) machine 0.24.1 worked*
<FromGitter> <jwoertink> Can someone take a look at this XML and see if I'm just missing something with how parsing works, or is this a bug?
<FromGitter> <jwoertink> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5afb6fa1b84be71db90d2bc6]
<FromGitter> <jwoertink> when there's a value in the xmlns attribute, no node is found
snsei has joined #crystal-lang