ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.33.0 | 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
alexcouch has joined #crystal-lang
alexcouch has quit [Remote host closed the connection]
dwdv has quit [Quit: quit]
<FromGitter> <Blacksmoke16> @andrewc910 yes, https://github.com/athena-framework
<FromGitter> <Blacksmoke16> still working on the serializer, then need to rework validation component, prob going to skip porting crylog if that sweet new stdlib `Log` module is in the works
<FromGitter> <christopherzimmerman> Anyone know how to turn a string into `Char**` to pass to a c lib? I've tried `[s.chars.to_unsafe]` and it takes it, but I feel like there's a better way.
<FromGitter> <Blacksmoke16> `**`? what's next `Char***`? :P
postmodern has joined #crystal-lang
<FromGitter> <Blacksmoke16> does `s.to_slice` not work?
<FromGitter> <Blacksmoke16> @christopherzimmerman ^
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/8kuv something like that maybe
sagax has quit [Quit: Konversation terminated!]
<postmodern> for value objects, should one use a struct or a tuple?
<FromGitter> <Blacksmoke16> Struct is usually preferred
<jrayhawk> Is there a way to prettyprint JSON?
<FromGitter> <Blacksmoke16> .to_pretty_json
<FromGitter> <Blacksmoke16> Instead of .to_json
<jrayhawk> Ah, thanks.
<postmodern> does Spectator support documentation output, where the describe/it strings get printed indented per line, like rspec does?
<FromGitter> <Brodan> I'm seeing `Error: undefined method 'post_form' for HTTP::Client`, any idea why? the docs show that it pretty clearly exists
<FromGitter> <tenebrousedge> you sure about that?
<FromGitter> <Brodan> nvm, i was linked to VERY old docs. im an idiot haha
<FromGitter> <tenebrousedge> :plus1:
<FromGitter> <tenebrousedge> it happens
<FromGitter> <Blacksmoke16> theres an issue for that
<FromGitter> <Blacksmoke16> postmodern https://crystal-lang.org/api/master/Spec.html#add_formatter(formatter)-class-method
<FromGitter> <Blacksmoke16> arent any docs on it but you could manually define a formatter that does that
<FromGitter> <Blacksmoke16> oh nvm it already exists as the `-v` or `--verbose` flag
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e4b4c649d4c83598b984880]
<FromGitter> <Blacksmoke16> example
<FromGitter> <Blacksmoke16> er sorry, this is the default `crystal spec -v` idk about that shard
<postmodern> Blacksmoke16, i tried setting formatter = Spectator::Formatting::DocumentFormatter, but the compiler didn't like that for some reason (it does inherit from the Formatter base class)
<FromGitter> <Blacksmoke16> what was the error?
ur5us has quit [Ping timeout: 240 seconds]
ur5us has joined #crystal-lang
<postmodern> Blacksmoke16, ah nevermind. Required an instance of it. Works now.
<FromGitter> <christopherzimmerman> @watzon I ended up creating a separate library (https://github.com/crystal-data/clcr) for opencl so its reusable
<FromGitter> <christopherzimmerman> In action (https://gist.github.com/christopherzimmerman/c35f5f38f3de1ce51e324967f99a8f24), defining a custom kernel
<FromGitter> <watzon> Awesome. That's a good idea.
<postmodern> is there a way to convert an Array(UInt8) into Bytes? not seeing a method in the API docs for Array.
<FromGitter> <Blacksmoke16> I'm pretty sure bytes is just an alias to that
<FromGitter> <christopherzimmerman> It’s an alias to Slice
<FromGitter> <Blacksmoke16> For convenience
<FromGitter> <Blacksmoke16> Ah
<FromGitter> <tenebrousedge> like `(0...array.size).each_with_object(Slice.new) {|idx, s| s[idx] = array[idx] }`
<FromGitter> <tenebrousedge> probably
<FromGitter> <Blacksmoke16> theres an easier way
<FromGitter> <tenebrousedge> o.o
<FromGitter> <Blacksmoke16> `Slice.new(arr.to_unsafe, arr.size)`
<FromGitter> <Blacksmoke16> would prob do the trick
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/master/Slice.html#new(pointer:Pointer(T),size:Int,*,read_only=false)-class-method
<FromGitter> <Blacksmoke16> but im not sure if it should be `arr.size` or like `sizeof` etc
<postmodern> both should work given that sizeof(UInt8) = 1
<postmodern> er unless Array has extra padding around it's uint8 elements?
<postmodern> ah that did the trick, thanks
infinisil has left #crystal-lang ["WeeChat 2.7"]
<postmodern> next question, how do you handle C function pointers that can be null? The value comes back as something like Proc(T,R):0x0
<FromGitter> <watzon> You can check for null pointers by using `Pointer#null?` if that's what you're asking
<postmodern> watzon, the field is defined as a Proc, so i'm getting a Proc that points ot 0x0. Should i define the field as Proc(T,R)?
<FromGitter> <watzon> Hmm good question. What's the method signature of the C function that you're wrapping?
<postmodern> watzon, basic C function pointer, void (*foo)(...). it's just that when the struct is init'd the field will be NULL.
<FromGitter> <watzon> Ahh ok, so it's a struct with a function pointer?
<FromGitter> <watzon> And the pointer is NULL to begin with?
<postmodern> watzon, correct. so my wrapping code needs to check for the NULL before inspecting the field
<FromGitter> <Blacksmoke16> er not exactly what you're looking for
<FromGitter> <watzon> That is something I didn't know existed. Interesting.
<FromGitter> <watzon> postmodern: could you share a code snippet so I can get a better idea of what we're dealing with? I'm having a hard time wrapping my head around the problem for some reason.
<FromGitter> <watzon> Very visual person here haha
<postmodern> Blacksmoke16, not exactly. Instead of leaving the data uninitialized, i call an C function that zeroes/resets all of the fields.
<postmodern> essentially i want to prevent against UD#syntax from being called when @ud has just been init'd by ud_init, which sets all pointers to NULL.
<FromGitter> <watzon> Ok, so the `if @ud.translator` guard clause isn't working?
<postmodern> watzon, correct, it's coming back as #<Proc(Pointer(LibUDis86::UD), Nil):0x0>
<FromGitter> <watzon> Give me a sec haha
<FromGitter> <watzon> I'm having a hard time figuring out what the `:0x0` means in this context. I've seen it with pointers before, but not procs.
<FromGitter> <watzon> I mean a proc is technically a wrapper around a pointer I think
<FromGitter> <watzon> Maybe you can check if `proc.pointer.null?`
<postmodern> watzon, ah didn't know you could go down that far into the Proc.
<FromGitter> <watzon> Yeah, let me know if that works
<FromGitter> <watzon> Fingers crossed
<postmodern> watzon, is there a cleaner way of detecting null C function pointers, and map them to a Nil?
<postmodern> seems to work!
<FromGitter> <watzon> Not that I know of unfortunately. Might be something to make an issue about and see what the maintainers think.
<FromGitter> <watzon> Because it would be nice to just have it be null instead of what basically amounts to a null proc, which I'm sure most people don't know exist
ur5us has quit [Ping timeout: 240 seconds]
<postmodern> what's the preferred way to link against a local libfoo.so? working on writing up an example for the null proc issue
sagax has joined #crystal-lang
<FromGitter> <watzon> That's a good question. Maybe using the `-L` flag in your linker options?
<FromGitter> <watzon> So `-L../vendor/libfoo/libfoo.so` or something. I haven't actually done it so I'm not sure.
alexcouch has joined #crystal-lang
<alexcouch> So I'm trying to use the socket api, and it's not entirely clear to me on the best approach to sending/receiving raw ICMP echo packets. I'm trying to construct the raw byte packets but the send method doesn't really like that. I've tried sending it as a Bytes object, but that yielded a hang on the receive method call. And I'm sending to
<alexcouch> destinations I have already confirmed are on my network. I''m struggling to understand what conventions to use for this kind of stuff. I get the conventions for sending packets in general for tcp, udp, etc are already built in but that's not gonna satisfy my case. I'm really just trying to rewrite a python module my team and I made in the company I
<alexcouch> work for, as a personal experiment. Could anyone point me in the right direction?
<postmodern> hmm -L./libfoo.so is finding the lib, but getting undefined references, even though i've extern'd the functions and can see them listed by nm -D
ur5us has joined #crystal-lang
<FromGitter> <watzon> You'd also have to do `-lfoo` to link the library
<FromGitter> <watzon> Where foo is the library name of course
_ht has joined #crystal-lang
_ht has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 240 seconds]
alexcouch has quit [Remote host closed the connection]
<postmodern> hmm it's not liking "-L./libfoo.so -lfoo"
<postmodern> also tried "-L./ -lfoo"
<FromGitter> <yxhuvud> https://github.com/yxhuvud/ior/blob/master/src/lib/liburing_shim.cr#L3 is one way. I wonder if there is any nicer way though, as it is pretty icky.
DeBot has quit [Quit: Crystal IRC]
asterite has quit [Quit: Bye]
jhass has quit [Quit: Bye]
DeBot has joined #crystal-lang
asterite has joined #crystal-lang
jhass has joined #crystal-lang
<postmodern> xyxhuvud, ah ha, #{__DIR__}/foo.o and #{__DIR__}/libfoo.so both work. Also looks like -L has to be given an absolute path, not a relative one.
Nicolab has joined #crystal-lang
Nicolab has quit [Quit: Leaving.]
ur5us has joined #crystal-lang
Nicolab has joined #crystal-lang
<FromGitter> <mavu> Is there a way for a method (class initializer in this case) to accept any argument that has a .to_json method?
Human_G33k has quit [Ping timeout: 260 seconds]
<FromGitter> <watzon> Glad you got it working postmodern 😊
<FromGitter> <watzon> @mavu not that I know of. This is why interfaces would be nice. Modules cover some use cases, but not this one.
<FromGitter> <mavu> @watzon thanks, that saved me from pointless searching :)
ur5us has quit [Ping timeout: 240 seconds]
Nicolab has quit [Quit: Leaving.]
Nicolab has joined #crystal-lang
<FromGitter> <yorci> hi
<FromGitter> <yorci> when i try to build on centos 7.6 i got this error. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e4bc2e10ec5ff431e9c7412]
<FromGitter> <yorci> but these packages are installed already
<FromGitter> <yorci> i also install crystal with centos repo
<FromGitter> <yorci> any suggestion?
<FromGitter> <codenoid> may help
<FromGitter> <yorci> @codenoid i need centos packages
<FromGitter> <codenoid> never use centos before, may just change `apt-get` to `yum` (?)
<FromGitter> <yorci> nope, different package names
<FromGitter> <codenoid> :(
<FromGitter> <yorci> but also these packages are installed
<FromGitter> <yorci> https://github.com/crystal-lang/crystal/wiki/All-required-libraries ⏎ ⏎ Fedora packages helped
HumanG33k has joined #crystal-lang
HumanG33k has quit [Read error: Connection reset by peer]
HumanG33k has joined #crystal-lang
HumanG33k has quit [Read error: Connection reset by peer]
HumanG33k has joined #crystal-lang
HumanG33k has quit [Read error: Connection reset by peer]
HumanG33k has joined #crystal-lang
HumanG33k has quit [Read error: Connection reset by peer]
HumanG33k has joined #crystal-lang
HumanG33k has quit [Read error: Connection reset by peer]
alexherbo2 has joined #crystal-lang
HumanG33k has joined #crystal-lang
HumanG33k has quit [Read error: Connection reset by peer]
HumanG33k has joined #crystal-lang
HumanG33k has quit [Read error: Connection reset by peer]
HumanG33k has joined #crystal-lang
Nicolab has quit [Ping timeout: 260 seconds]
gangstacat has quit [Quit: Ĝis!]
alexherbo2 has quit [Ping timeout: 268 seconds]
gangstacat has joined #crystal-lang
<FromGitter> <Blacksmoke16> @mavu couldnt you just not add a type restriction? It would obs fail if the type doesnt support `.to_json`
<FromGitter> <Blacksmoke16> which would be similar to `method .to_json does not exist on SerializableInterface`
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 260 seconds]
alexherbo2 has joined #crystal-lang
postmodern has quit [Quit: Leaving]
<FromGitter> <smw> hi crystal people! I'm really enjoying the language, but I ran into a stumbling block:
<FromGitter> <smw> if I have an array of (Type | Nil), and I want to remove the Nils and turn it into an array of Type, how do I get the compiler to accept that?
<FromGitter> <tenebrousedge> `try`, `not_nil!` or `as`
<FromGitter> <tenebrousedge> and probably you should consider them in that order
<FromGitter> <tenebrousedge> you may also be able to use `compact` with an array, if the position doesn't matter
<FromGitter> <smw> Ok, I'm not quite following...
<FromGitter> <smw> if I have an array with some elements as Nil, and I call compact on it, will the compiler now understand the new type of the array?
<FromGitter> <Blacksmoke16> pretty sure you would have to go with `#compact` to create a new array without `Nil`
<FromGitter> <Blacksmoke16> otherwise the type of the original array will still be `Type?` even if it doesnt have `nil` values
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/8kyo
<FromGitter> <smw> That seems to do it, thank you!
<FromGitter> <Blacksmoke16> `#compact!` cant be used either, even tho it removes `nil`, it still retains the type since its the same array https://play.crystal-lang.org/#/r/8kyp
<FromGitter> <smw> but you can do array = array.compact and it changes type
<FromGitter> <Blacksmoke16> to be clear it doesnt *change* the type of the array
<FromGitter> <Blacksmoke16> it creates a *new* array
<FromGitter> <Blacksmoke16> with a different type
<FromGitter> <smw> right, fair enough. the type associated with the variable binding changes?
<FromGitter> <smw> not sure the correct terminology in crystal
<FromGitter> <Blacksmoke16> > the type associated with the variable binding changes? ⏎ ⏎ hm?
<FromGitter> <Blacksmoke16> ```arr = [1, nil, 3] ⏎ arr = arr.compact``` [https://gitter.im/crystal-lang/crystal?at=5e4bf2a6c2c73b70a4428330]
<FromGitter> <Blacksmoke16> its more so you're just overriding the value of `arr`
<FromGitter> <Blacksmoke16> with a new array so its type changes
<FromGitter> <smw> I'm following you. Having trouble thinking of other statically typed languages where the *name* `arr` would have a type associated with it?
<FromGitter> <Blacksmoke16> its optional
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/8kyq
<FromGitter> <smw> Is there a difference between using the arr = [] of x syntax in the arr: Array(x) syntax?
<FromGitter> <tenebrousedge> there used to be some edge cases where the compiler didn't like the first syntax, I think. Not sure if those were fixed
<FromGitter> <Blacksmoke16> there is a diff
<FromGitter> <smw> but is one talking about the variable name and the other what it's pointing to?
<FromGitter> <Blacksmoke16> the first is setting the value of `arr` to be an empty array of `X`, where the type is inferred to be `Array(X)`
<FromGitter> <j8r> I prefer using the generic one, always
<FromGitter> <Blacksmoke16> the latter one is declaring `arr`'s type, but not setting its value
<FromGitter> <Blacksmoke16> i.e. with the first you could do `arr = "foo"`, the second you couldn't
<FromGitter> <smw> and in the later one, the type of arr is set permanently?
<FromGitter> <j8r> It is more natutal `@ary : Array(String) = Array(String).new` than `@ary : Array(String) = [] of String`
<FromGitter> <j8r> the only main use case is `["a", "b", "c"] of String | Int32`
<FromGitter> <smw> does `@ary : Array(String) = []` not do the same thing by type inference?
<FromGitter> <smw> reverse type inference?
<FromGitter> <j8r> it does not work yes
<FromGitter> <Blacksmoke16> you would still have to do `[] of String` to tell it what the empty array should be
<FromGitter> <Blacksmoke16> as without it, it's untyped
<FromGitter> <j8r> because a `[]` value is not a thing
<FromGitter> <smw> Ok. I think I'm catching on. Thank you again!
<FromGitter> <j8r> I have propose to remove this syntax in the past, to have less ways and confusions
<FromGitter> <Blacksmoke16> what `[] of Type`?
<FromGitter> <j8r> this
<FromGitter> <Blacksmoke16> why?
<FromGitter> <Blacksmoke16> it has its uses, esp when working with macros
<FromGitter> <j8r> I didn't say in macro, only in the language
<FromGitter> <Blacksmoke16> sorry i mean if you use a macro to build out an array
<FromGitter> <Blacksmoke16> ```{{values}} of Type```
<FromGitter> <j8r> `[]` will work too?
<FromGitter> <Blacksmoke16> not when values is a child type and you want it to use the parent type's type
<FromGitter> <j8r> Quite sure there are work arounds
<FromGitter> <j8r> Sure there are pros
<FromGitter> <j8r> But at the same time there are cons
<FromGitter> <j8r> like this syntax doesn't work in some places, and one more thing to learn
<FromGitter> <Blacksmoke16> both have their uses
<FromGitter> <yxhuvud> `Array(Supertype){values}`
<FromGitter> <yxhuvud> (perhaps you need some more {{}}s.
<FromGitter> <j8r> @yxhuvud πŸ‘ , the only sing is one says it was less efficient than the `of` syntax
ancorgs has left #crystal-lang ["Konversation terminated!"]
<FromGitter> <bararchy> @watzon @christopherzimmerman if you get GPU working let me know XD
<FromGitter> <bararchy> Anything like `includes?` but for enumerable? like, can I see if this array holds anything for other array?
<FromGitter> <christopherzimmerman> I am working on generalizing it a bit, but within the next few days I'm going to be adding `ClTensors` to my library :). Once I got the OpenCL bindings working, adding in all of the elementwise kernels/linear algebra libraries was pretty trivial. If you want I can submit a PR at some point to back SHAINet with tensors (CPU and GPU).
<FromGitter> <bararchy> Oh wow that would be amazing!
<FromGitter> <bararchy> @ArtLinkov ^ you'll love this
<FromGitter> <tenebrousedge> @bararchy `array & other` ?
<FromGitter> <christopherzimmerman> I posted this example (https://gist.github.com/christopherzimmerman/c35f5f38f3de1ce51e324967f99a8f24) yesterday using the wrapper I'm working on. Kernels do have to be JIT compiled unfortunately, which adds a bit of overhead. If you don't want to add num.cr to the library directly, you could always just use the OpenCL wrappers. I'm planning on adding a similar one for CUDA once I have a
<FromGitter> ... compatible card.
<FromGitter> <bararchy> oh...CUDA, my beloved and most hated lib in the world
<FromGitter> <christopherzimmerman> CUDA is going to be a *lot* easier than OpenCL, don't worry :). I am really motivated to get better deep learning tools into Crystal, especially since I'm changing jobs and won't be doing any ML at work anymore. Gotta get my fix somewhere else.
<FromGitter> <ArtLinkov> @christopherzimmerman this sounds awesome :)
<FromGitter> <christopherzimmerman> I'm very excited. By far the biggest thing my numerical library was GPU support. Hopefully it starts bringing more people to Crystal
<FromGitter> <ArtLinkov> Looking forward to it! Ping me when it's ready, I'll love to take a look
<FromGitter> <PlayLights_twitter> Hello There, I have a simple question, I haven't looked at the base Dockerfile but why the crystal image is so heavy? like 550mb
<FromGitter> <PlayLights_twitter> yeah I know like 280MB, which is a lot more than a node/ruby alpine
<FromGitter> <Daniel-Worrall> I keep seeing alpine and musl being the only way to statically compile, but what I really want to know is *why*
<FromGitter> <PlayLights_twitter> that was I think its weird
<FromGitter> <tenebrousedge> the size could probably be reduced by making it a multistage build
<FromGitter> <tenebrousedge> ah, no, it is
<FromGitter> <tenebrousedge> I got nothing
<FromGitter> <tenebrousedge> maybe it's just an interpreter-vs-compiler thing
<FromGitter> <Blacksmoke16> @Daniel-Worrall because alpine uses a diff `musl libc`
<FromGitter> <Blacksmoke16> which i guess is easier/only one that supports static linking versus the normal `libc`
_ht has joined #crystal-lang
<FromGitter> <straight-shoota> Gnu libc can't be statically linked.
<FromGitter> <straight-shoota> Or technically, it can but it doesn't properly work
<FromGitter> <straight-shoota> musl instead is designed for statically linking
<FromGitter> <Daniel-Worrall> so it's a design feature that we can integrate with
<FromGitter> <Blacksmoke16> does that mean like Go also only supports static linking on alpine?
<FromGitter> <straight-shoota> Go doesn't link against libc at all.
<FromGitter> <straight-shoota> If you need C interop, you can use cgo but that doesn't link statically against glibc as all.
<FromGitter> <Blacksmoke16> and i imagine we need libc for c bindings and some system level stuff?
<FromGitter> <straight-shoota> yes
<FromGitter> <Blacksmoke16> how does Go handle their system level stuff in that case? Just don't offer anything similar to what we have or?
<FromGitter> <straight-shoota> They just implement everything themselves and call system calls directly.
<FromGitter> <Blacksmoke16> gotcha
<FromGitter> <straight-shoota> That actually doesn't seem too much of an effort. We should be able to do the same thing without too much hassle, I suppose. But then you can't use other c libraries as well because they all depend on libc.
<FromGitter> <straight-shoota> @PlayLights_twitter regarding alpine image size, see https://forum.crystal-lang.org/t/official-alpine-docker-image/1376/4
<FromGitter> <kinxer> Why can't we re-open an enum to add more constants?
<FromGitter> <Blacksmoke16> id imagine it could be ok if you add them to the end, otherwise things would break
<FromGitter> <tenebrousedge> I think enums are pretty "magical"
<FromGitter> <Blacksmoke16> but gets tricky when you try to open it multiple times, what would the order be, maybe not an issue if every member has a value explicitly defined?
<FromGitter> <Daniel-Worrall> though that's nightly
<FromGitter> <Daniel-Worrall> https://hub.docker.com/r/crystallang/crystal/tags?page=1&name=alpine click on the digest for more info
<FromGitter> <straight-shoota> @Daniel-Worrall There's no difference between nightly and latest, except for different crystal build and source
<FromGitter> <Daniel-Worrall> yeah, I know
<FromGitter> <kinxer> Hm... I'm trying to figure out if there's a good way to build an enum as part of multiple invocations of different macros (which already do other things).
<FromGitter> <Daniel-Worrall> Just don't want to point someone in the direction of a nightly without them knowing it is such
<FromGitter> <straight-shoota> @Daniel-Worrall I don't think the docker layers don't provide any meaningful insights.
<jhass> kinxer: I guess you could always collect and generate in a finished hook
<FromGitter> <straight-shoota> It's much better to look at what's inside the final image: The crystal compiler (66 MB), shards (8 MB), git (12MB), default libraries (40MB total), gcc (80MB) and alpine base image (3MB).
<FromGitter> <straight-shoota> @kinxer Would help if you could elaborate more on the use case
<jhass> I would prefer designs that can avoid this but yeah
<FromGitter> <tenebrousedge> neat
<jhass> neat until you have a dozen things doing something on finished and depending on each other you don't understand anything anymore :P
<FromGitter> <tenebrousedge> I save time by not understanding anything after I finish writing it :D
<FromGitter> <Daniel-Worrall> why do those 2 macros do the same thing tho
<jhass> just an example
<jhass> they can do different things additionally
<jhass> as that was kinxer's question, to build a single enum for calls to two different macros
sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter> <mavu> @Blacksmoke16 (late reply, everyone else, best ignore :) ) Current plan : use Union type of AppConfig | Array. both Types I know support .to_json. And I don't have to use the appconfig class when testing in isolation. not tested yet, something came up, but should work i think.
<FromGitter> <Blacksmoke16> okey dokey
<livcd> are there any gtk apps in Crystal?
ur5us has joined #crystal-lang
<FromGitter> <kinxer> @jhass Thanks for the prototype. Unfortunately, this idea was intended to help avoid the use of `Symbol`. I'll try to figure out a good analogous use-case.
<jhass> well you can pass anything really
sorcus has quit [Quit: WeeChat 2.7]
<jhass> just gotta be able to store it to an array in some form and convert it to an identifier after
<FromGitter> <jwoertink> Has anyone here booted a crystal app on ClearLinux docker?
sorcus has joined #crystal-lang
darkstardevx has quit [Remote host closed the connection]
darkstardevx has joined #crystal-lang
<FromGitter> <kingsleyh> after upgrading to 0.33.0 - my specs are failing with this error: `Can't read UInt64 at 1:20` - were there any changes that could have caused this?
_ht has quit [Remote host closed the connection]
<FromGitter> <kingsleyh> It seems like it's something to do with Json parsing
alexherbo23 has joined #crystal-lang
alexherbo23 has quit [Client Quit]
alexherbo28 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 265 seconds]
alexherbo28 is now known as alexherbo2
<FromGitter> <kingsleyh> In Crystal 0.32.1 - although the JSON.parse prints out an incorrect negative number - the Item.from_json works correctly: https://carc.in/#/r/8l16 but the same code in crystal 0.33.0 - returns the negative number then blows up on the Item.from_json: https://carc.in/#/r/8l17
<FromGitter> <kingsleyh> any idea what the correct way to fix this is?
sagax has quit [Remote host closed the connection]
<FromGitter> <Blacksmoke16> https://carc.in/#/r/8l1f reduced https://carc.in/#/r/8l1f
<FromGitter> <Blacksmoke16> https://carc.in/#/r/8l1h reduced more
<FromGitter> <Blacksmoke16> issue is `read_int` returns `Int64`, which apparently overflows when calling `to_u64` id make an issue for it
<FromGitter> <Blacksmoke16> no, `read_int` overflows but wraps
<FromGitter> <Blacksmoke16> which fails `.to_u64` since its negative
<FromGitter> <tenebrousedge> o.o
sz0 has joined #crystal-lang
postmodern has joined #crystal-lang
<FromGitter> <kingsleyh> so it's a bug in the Json parsing library?
<FromGitter> <kingsleyh> is there any workaround for the time being? or maybe I'll drop back to 0.32.1 for now
<FromGitter> <Blacksmoke16> Maybe set type as string and manually call to_u64
<FromGitter> <Blacksmoke16> Or manually define a converter to do it in
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang