<FromGitter>
<ImAHopelessDev_gitlab> plural i'm pretty sure, cause the (s)
<FromGitter>
<ImAHopelessDev_gitlab> but i bet a linguistic can craft a sentence to make it sound singular...
go|dfish has quit [Ping timeout: 240 seconds]
dwdv has joined #crystal-lang
<dwdv>
Should `.reduce(Set{{0,0}})` be allowed syntax-wise? Currently I have to do `.reduce(Set{ {0,0} })`.
<FromGitter>
<Blacksmoke16> Probably is conflicting with the macro syntax
<dwdv>
Almost like the good old `> >` in pre-C++11 land, eh? :)
<FromGitter>
<tenebrousedge> `reduce(Set.new({0,0}))` seems like a thing there
<dwdv>
Negative, gives me a `Set{0}`.
<dwdv>
`Error: no overload matches 'Set(Int32)#<<' with type Tuple(Int32, Int32)`
<dwdv>
Anyway, thanks again for your time, heading to bed. Have a good one.
dwdv has quit [Ping timeout: 240 seconds]
<FromGitter>
<Daniel-Worrall> Alexherbo20, singular is difference. Plural is difference if it is uncountable or differences if countable. I thought the link was clear
baweaver has quit [Excess Flood]
baweaver has joined #crystal-lang
<FromGitter>
<AmberSaber> When I upgrade crystal, I usually have to upgrade llvm. But the upgrade of llvm has been going on for two days, and it's not over
<FromGitter>
<Blacksmoke16> Oh?
<FromGitter>
<Blacksmoke16> How did you install crystal?
<FromGitter>
<sdogruyol> I'll try my best to translate the talk and add captions...also open to present in another conferences :)
<FromGitter>
<sdogruyol> Now to announce my new project
<FromGitter>
<bajro17> @sdogruyol also please your yt SEO if I type crystal lang it dont show me just in tags add crystal lang
<FromGitter>
<bajro17> also it will be good on crystal lang website put like remainder for people who create yt videos to use crystal lang tag
alexherbo2 has joined #crystal-lang
<FromGitter>
<sam0x17> we should just go back in time and erase crystal reports and the "healing crystals" movement
<FromGitter>
<kefahi> Hello, I'm done with maintaining a very basic JSON schema validation library based on a 4-years old code. In case any one is interested to further mature. Thanks!
<FromGitter>
<zenithlight> @absolutejam_twitter wondering if there is already a package for crystal code generation fro swagger
<FromGitter>
<kefahi> On another front, I'm searching for a library that can do PGP. To my knowledge neither sodium or ssl could do that. Generating keys, signing, verifying ...etc.
_whitelogger has joined #crystal-lang
<FromGitter>
<sdogruyol> @bajro17 good one! Thanks!
<FromGitter>
<sdogruyol> @kefahi amazing! Great job on reviving the project :)
xyproto has left #crystal-lang ["WeeChat 2.6"]
alexherbo26 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 240 seconds]
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 265 seconds]
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
alexherbo26 has quit [Ping timeout: 265 seconds]
alexherbo26 has joined #crystal-lang
<FromGitter>
<eliasjpr> Int.months and int.year should be returning Time::Span not Time::MonthSpan
<FromGitter>
<eliasjpr> It makes the api inconsistent
apg has joined #crystal-lang
<FromGitter>
<sam0x17> @asterite what was your plan for dealing with unions with marshaling? I'm at that point where that's all I have to deal with now. I'm in a place where if I know the particular type of the object that was stored in the union, I'm good, but I'm probably going to have to modify things so I store the actual type along with the object data (just in the case of unions).
<FromGitter>
<ilanpillemer> thats an interesting error
<FromGitter>
<tenebrousedge> I think the better answer is to not use a char array, especially since this is an intermediate variable anyway
<FromGitter>
<tenebrousedge> this code feels like writing C in Crystal
<FromGitter>
<ilanpillemer> Yeah.
<FromGitter>
<ilanpillemer> Probably because I wrote it
<FromGitter>
<ilanpillemer> And `Go` is `C` in disguise.
<FromGitter>
<tenebrousedge> one thing that may help: `join` takes a block argument
<FromGitter>
<tenebrousedge> you may also want to take a look at `StringBuilder`
<FromGitter>
<tenebrousedge> if there's a way to use a lazily-evaluated `Iterator` that would help too
<FromGitter>
<ilanpillemer> the array will grow bigger than INt32
<FromGitter>
<ilanpillemer> so if its impossible to have an array bigger than Int32.. I need to rethink completely
<FromGitter>
<tenebrousedge> what I'm saying is you probably don't need an array
<FromGitter>
<tenebrousedge> if you're just doing `join` at the end of all of this, you should be able to use `StringBuilder`, or equivalently put a ton of logic in the `join` block
<FromGitter>
<tenebrousedge> but either way you can go straight to a string without needing the array
<FromGitter>
<ilanpillemer> can join deal with bigger than in32?
<FromGitter>
<ilanpillemer> I thought the error was the concat
<FromGitter>
<tenebrousedge> what you're iterating over will need to be smaller than `Int32`
<FromGitter>
<tenebrousedge> but that could be like `each_line` or something
<FromGitter>
<ilanpillemer> I just snuck a look at aserite’s solution
<FromGitter>
<tenebrousedge> your input isn't more than 2**32 characters
<FromGitter>
<ilanpillemer> it is eventually
<FromGitter>
<ilanpillemer> as it decompresses
<FromGitter>
<tenebrousedge> so the final string will be that large, but not necessarily what you're iterating over
<FromGitter>
<ilanpillemer> the inital string is not that large
<FromGitter>
<ilanpillemer> so you need to be able to count without decompressing
<FromGitter>
<ilanpillemer> which is what asterite did
<FromGitter>
<ilanpillemer> but its an interesting limitatino
<FromGitter>
<tenebrousedge> I think it's sane. That seems like the point where a different approach is called for, other than the stdlib array
<FromGitter>
<tenebrousedge> probably the input size is calculated to force you to avoid brute-force solutions
<FromGitter>
<ilanpillemer> well, it was definitely put there to make one pause and rethink.
<FromGitter>
<ilanpillemer> I think it broke my brain. I will completely rewrite tomorrow night because my brain normally regenerates over 24 hours.
<FromGitter>
<tenebrousedge> gin helps :)
<FromGitter>
<sam0x17> lol
<FromGitter>
<ilanpillemer> I may have to go for the liquorice
<FromGitter>
<ilanpillemer> as a last resort
<FromGitter>
<ilanpillemer> essentially I have to recursively count the lengths and maintain a running total
<FromGitter>
<sam0x17> so jumping in late, but is this a "array larger than int32" situation?
<FromGitter>
<ilanpillemer> yes
<FromGitter>
<sam0x17> does it have to all be in memory at once?
<FromGitter>
<ilanpillemer> I think an array in Uint64 territory
<FromGitter>
<ilanpillemer> is there a way having an array bigger than int32?
<FromGitter>
<sam0x17> if you have the RAM for it, you could just allocate an arbitrary block of memory with a C malloc call, and then use pointers to work with it
<FromGitter>
<sam0x17> actually everything in `Pointer` would probably be enough
<FromGitter>
<sam0x17> then just use Int64 or UInt64 for everything
<FromGitter>
<sam0x17> but this is almost always unnecessary -- it's one thing if you are loading massive maps for a game or something and they *have* to be in ram, but if you are doing some kind of analysis, you could probably get away with just streaming through the data in which case it doesnt all have to be in ram
<FromGitter>
<ilanpillemer> There is definitely a way to get the answer through streaming.
<FromGitter>
<sam0x17> yeah I would do that then
<FromGitter>
<ilanpillemer> However, learning how to do it with ram would be interesting
<FromGitter>
<sam0x17> another interesting solution would be to do an array of arrays and then write methods on that class to pass `[]` to the proper array
<FromGitter>
<sam0x17> that's the only "safe" solution other than streaming
<FromGitter>
<ilanpillemer> I am doing this to purely to experiment with the language
<FromGitter>
<sam0x17> it's something like `Pointer([array type]).malloc(size)`
<FromGitter>
<ilanpillemer> so interesting trumps best
<FromGitter>
<sam0x17> slices also very applicable
<FromGitter>
<sam0x17> `Slice` etc
<FromGitter>
<sam0x17> but yeah if it was me I would do some sort of tight loop (streaming) unless this was loading resources for a game
<FromGitter>
<tenebrousedge> it's a decompression algo
<FromGitter>
<sam0x17> you can parallelize also depending on what you doin
<FromGitter>
<sam0x17> ah
<FromGitter>
<ilanpillemer> I can theoretically understand how to do it with streaming. Which means it just matter of picking my brain up first from the floor. And waiting for it to respawn. But this pointer stuff is interesting.
<FromGitter>
<sam0x17> this is always a pain point with compression
<FromGitter>
<sam0x17> if you working with gzip, the built in stuff does allow for streaming but you have to take a look at how the zlib libraries work in the crystal std lib
<FromGitter>
<ilanpillemer> in theory with decompression you really might want to decompress and not just know the size
<FromGitter>
<tenebrousedge> oh, you just have to know the size here/
<FromGitter>
<sam0x17> right but you should be able to do it to disk
<FromGitter>
<sam0x17> you can also dump off into an `IO::Memory` and not know the size
<FromGitter>
<ilanpillemer> to get the “star” you just need to know the size. Streaming is sufficient. But I am interested in the thing itself.