ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.22.0 | Fund Crystal's development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
<FromGitter> <eliasjpr> Ahh! I see so a generic is a polymorphic type
<FromGitter> <eliasjpr> :)
<FromGitter> <Sija> see `Array#map` for example
<FromGitter> <eliasjpr> and its representation is `T`
<FromGitter> <eliasjpr> k
<FromGitter> <Sija> it would seems so :)
<FromGitter> <eliasjpr> :)
<FromGitter> <eliasjpr> same concept different names
<FromGitter> <Sija> yup
<FromGitter> <Sija> https://crystal-lang.org/api/0.22.0/Enumerable.html#map%28%26block%3AT-%3EU%29forallU-instance-method
<FromGitter> <eliasjpr> life of a programmer lol
<FromGitter> <Sija> haha, just life ;)
zipR4ND has quit [Ping timeout: 260 seconds]
<FromGitter> <eliasjpr> just life…:)
<FromGitter> <elorest> I think of polymorphic as classes that inherit from a single base class. Like with the case of abstract classes.
<FromGitter> <Sija> quite common paradigm throughout OO languages, polymorphic types not so much
<FromGitter> <eliasjpr> ocaml polymorphic type declaration
<FromGitter> <eliasjpr> Generics and Polymorphic type is the same concept
<FromGitter> <Sija> ocaml… ;)
<FromGitter> <eliasjpr> lol
<FromGitter> <Sija> obviously there’s more use-cases for compiled languages than for interpeted ones
<FromGitter> <eliasjpr> Which why I am surprised that is not part of crystal
<FromGitter> <Sija> programing world is vast and wild so there r many ways of approaching things
<FromGitter> <Sija> now u know it is :)
<FromGitter> <eliasjpr> I mean I guess it is with generics
<FromGitter> <eliasjpr> im still grasping the generics implementation
<FromGitter> <Sija> C++ has ‘em too btw (as templates)
<FromGitter> <eliasjpr> :thumbsup:
ezrast has joined #crystal-lang
Philpax has joined #crystal-lang
ezrast has quit [Ping timeout: 260 seconds]
<aarongodin> hey everyone, just learning the syntax for crystal in the last week or so and very excited. Does anyone know if there are some shards made for building guis?
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
balduin has joined #crystal-lang
vikaton has quit [Quit: Connection closed for inactivity]
yogg-saron has joined #crystal-lang
unshadow has quit [Ping timeout: 276 seconds]
unshadow has joined #crystal-lang
Cyrus has joined #crystal-lang
<aarongodin> nice. even that site is a big help, lots of interesting things on there
ChickeNES has joined #crystal-lang
yogg-saron has quit [Ping timeout: 276 seconds]
balduin has quit [Ping timeout: 240 seconds]
mark_66 has joined #crystal-lang
Qchmqs has joined #crystal-lang
Qchmqs has quit [Read error: Connection reset by peer]
zipR4ND has joined #crystal-lang
Qchmqs__ has joined #crystal-lang
Qchmqs__ is now known as Qchmqs
Yxhuvud has quit [Ping timeout: 240 seconds]
Qchmqs is now known as Frites
Yxhuvud has joined #crystal-lang
bjz has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
Majost has quit [Remote host closed the connection]
hmans has quit [Remote host closed the connection]
sz0 has quit [Read error: Connection reset by peer]
twisterghost has quit [Remote host closed the connection]
mroth has quit [Remote host closed the connection]
aemadrid has quit [Remote host closed the connection]
mroth has joined #crystal-lang
aemadrid has joined #crystal-lang
twisterghost has joined #crystal-lang
Majost has joined #crystal-lang
zipR4ND has quit [Ping timeout: 240 seconds]
hmans has joined #crystal-lang
sz0 has joined #crystal-lang
balduin has joined #crystal-lang
zipR4ND has joined #crystal-lang
splitty__ has joined #crystal-lang
splitty___ has quit [Ping timeout: 240 seconds]
bjz_ has joined #crystal-lang
<FromGitter> <luislavena> @fridgerator re: `HTTP::Client` usage, spawning in multiple fibers a single client connection might result in race conditions. A pool of connections will be a better approach
<FromGitter> <CodelessFuture> Crypto::MD5.hex_digest("foo”) find this in the API…..I cannot find a way to use it….what module I nned to require?
bjz has quit [Ping timeout: 276 seconds]
<FromGitter> <CodelessFuture> Ok….figured out. OLD API version….
<FromGitter> <luislavena> @CodelessFuture old API, try use latest. I believe is under `Digest::MD5`, you can see in the docs it states were is defined in the files (`digest/md5.cr`) https://crystal-lang.org/api/0.22.0/Digest/MD5.html
<FromGitter> <CodelessFuture> @luislavena yes thank you when I post the link I realised
bjz_ has quit [Ping timeout: 240 seconds]
bjz has joined #crystal-lang
<wuehlmaus> hmm, i am not able to ``require "Math"'' on my Apple, crystal version is 0.22.
<wuehlmaus> i bet this is known already.
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<wuehlmaus> 0.22.0
<FromGitter> <luislavena> @wuehlmaus you need to require `math`, is case-sensitive (most likely your OSX filesystem is)
<wuehlmaus> ah, yes i just tried that
<wuehlmaus> thanks
<FromGitter> <sdogruyol> yeah os x is case sensitive
<FromGitter> <luislavena> @sdogruyol ah, that's new, last time with Slow Leopard it wasn't by default, lot of headaches in Ruby land because of that :smile:
<FromGitter> <sdogruyol> oh how i miss snow leopard
Philpax has quit [Ping timeout: 240 seconds]
<FromGitter> <Sija> is there a way to build a target from a dependency?
<FromGitter> <Sija> sth like `shards build <dep>/<target>`?
<FromGitter> <Sija> I can probably define my own `target` pointing to the dependency but that’s not rly DRY
<wuehlmaus> sdogruyol: i just tried ``touch /tmp/name'' and was able to ``rm /tmp/NAME'' which was not existing before i did ``touch /tmp/name''. so it seems, Sierra is not case sensible.
<FromGitter> <sdogruyol> that actually depends on your disk format
<wuehlmaus> i did not tune that.
<crystal-gh> [crystal] bcardiff pushed 1 new commit to master: https://git.io/v94Hr
<crystal-gh> crystal/master 3b752a3 Brian J. Cardiff: Fixes #4336. Use original_location for debug info
<FromGitter> <luislavena> @Sija I've only seen that trick done using `postinstall` hook of shards, one example: https://github.com/ysbaddaden/panzer/blob/master/shard.yml
zipR4ND has quit [Ping timeout: 276 seconds]
<FromGitter> <Sija> @luislavena thx, I’ve been evaluating `postinstall` hook but its too hackish for my use - for instance there’s no way of passing arguments to the build command
<FromGitter> <Sija> `shards build` should IMHO lookup & build dependent `target`s too...
<FromGitter> <Sija> seems logical
<FromGitter> <luislavena> @Sija see the executables discussion on Shards issue tracker and voice our your use case there: https://github.com/crystal-lang/shards/pull/126
<FromGitter> <Sija> @luislavena thx, I was just looking for that issue :)
<FromGitter> <Sija> damn, those smileys are fucked
zipR4ND has joined #crystal-lang
bcardiff has joined #crystal-lang
bcardiff has left #crystal-lang [#crystal-lang]
mark_66 has quit [Read error: Connection reset by peer]
mark_66 has joined #crystal-lang
avdi has quit [Ping timeout: 264 seconds]
ome has quit [Ping timeout: 264 seconds]
twisterghost has quit [Ping timeout: 276 seconds]
tatey has quit [Ping timeout: 240 seconds]
t-richards has quit [Ping timeout: 264 seconds]
justinmcp has quit [Ping timeout: 255 seconds]
Liothen has quit [Ping timeout: 255 seconds]
justinmcp has joined #crystal-lang
FromGitter has quit [Ping timeout: 260 seconds]
twisterghost has joined #crystal-lang
dzv has quit [Ping timeout: 264 seconds]
livcd has quit [Ping timeout: 260 seconds]
dzv has joined #crystal-lang
Majost has quit [Ping timeout: 255 seconds]
livcd has joined #crystal-lang
hmans has quit [Ping timeout: 264 seconds]
ome has joined #crystal-lang
ben has quit [Ping timeout: 260 seconds]
aemadrid has quit [Ping timeout: 276 seconds]
manveru has quit [Ping timeout: 264 seconds]
kiliankoe has quit [Ping timeout: 255 seconds]
hmans has joined #crystal-lang
Majost has joined #crystal-lang
Liothen has joined #crystal-lang
tatey has joined #crystal-lang
kiliankoe has joined #crystal-lang
ben__ has joined #crystal-lang
t-richards has joined #crystal-lang
DeBot has quit [Quit: Crystal IRC]
aemadrid has joined #crystal-lang
avdi has joined #crystal-lang
manveru has joined #crystal-lang
<wuehlmaus> is it possible to have the "api" documentation offline or even possible as gitbook?
<oprypin> wuehlmaus, what does gitbook have to do with api documentation
<oprypin> to get api documentation, you run `make doc`
<oprypin> what the actual f**k is going on on that page? DOCKER!?!?!?
<oprypin> instead of skipping the '-g' flag one could use docker, good job
<oprypin> to be fair, gitbook would still put things into $HOME/.gitbook, which is kinda "global" and not easily preventable. so it's something. sorry for yelling.
Yxhuvud has quit [Read error: Connection reset by peer]
Yxhuvud has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
Frites has quit [Ping timeout: 240 seconds]
bcardiff has joined #crystal-lang
LastWhisper____ has joined #crystal-lang
unshadow has quit [Quit: leaving]
leafybas- has quit [Quit: ZNC 1.6.1+deb1~ubuntu14.04.0 - http://znc.in]
Yxhuvud has quit [Read error: Connection reset by peer]
Yxhuvud has joined #crystal-lang
bcardiff has quit [Quit: bcardiff]
zipR4ND has quit [Ping timeout: 240 seconds]
bcardiff has joined #crystal-lang
zipR4ND has joined #crystal-lang
DeBot has joined #crystal-lang
bcardiff has quit [Quit: bcardiff]
bcardiff has joined #crystal-lang
FromGitter has joined #crystal-lang
<FromGitter> <bew> loool
FromGitter has quit [Remote host closed the connection]
FromGitter has joined #crystal-lang
Ven has joined #crystal-lang
Ven is now known as Guest85489
<oprypin> sorry for inconvenience, the irc<->gitter bridge bot has been down for the last 5-6 hours
<FromGitter> <bew> it's back now :) why was it a down?
<oprypin> not entirely sure. kept getting timeouts and SSL errors from IRC side, might have been network connectivity problems on my VPS, and then... someone occupied that nickname
<oprypin> turns out registering a nick is not enough on freenode, you need to manually kick someone with your nick. or /msg nickserv help set enforce
<Papierkorb> it's normal that you have to ghost an impostor
<oprypin> why is it normal?
<Papierkorb> it's been the case on every IRC network I've ever been
<oprypin> mkay
<Papierkorb> QuakeNet is an exception which doesn't guarantee nicks anyway
bmcginty has quit [Ping timeout: 260 seconds]
<FromGitter> <c910335> @Sija So the reason is broken meta-model?
<FromGitter> <Sija> That’s my understanding, yep
<FromGitter> <Sija> In case of Generics it’s even worse
<FromGitter> <c910335> Thanks
bcardiff has quit [Quit: bcardiff]
vikaton has joined #crystal-lang
<FromGitter> <bew> is there a way to resize an `IO::Memory` ?
<FromGitter> <bew> there is `IO::Memory#resize_to_capacity` but it's private :/
<FromGitter> <Sija> IIRC it resizes itself
<FromGitter> <Sija> > he internal buffer can be resizeable and/or writeable depending on how an IO::Memory is constructed.
<FromGitter> <bew> yeah, but it's not me writing to it, it's some C code..
<FromGitter> <bew> but nvm, I'll use Slice directly, with a proper realloc
Guest85489 has quit [Ping timeout: 264 seconds]
<FromGitter> <Sija> why not use `IO::Memory#write`?
Ven has joined #crystal-lang
Ven is now known as Guest35405
<FromGitter> <bew> it's some C code that write in the buffer
<FromGitter> <bew> not me
<FromGitter> <bew> (not crystal code)
<FromGitter> <Sija> what do u mean by “C code”?
<FromGitter> <Sija> proc?
<FromGitter> <bew> I'm writting a lib binding, with a nice wrapper
<FromGitter> <Sija> You can `Box` it and use it inside of C proc
<FromGitter> <bew> maybe you're tired (or I am?), but I trying to pass a buffer to a C function, so the C function can fill the buffer..
<FromGitter> <Sija> yep, that’s me, sorry for the noise ;)
<FromGitter> <bew> don't worry ;)
<FromGitter> <bew> another question:
<FromGitter> <bew> what's the difference between `GC.malloc` & `GC.malloc_atomic` ? (no doc in api reference..)
<oprypin> bew, iirc malloc_atomic tells GC that this memory cannot possibly have pointers so it doesnt need to track it
<oprypin> like array of Int32 would be allocated with malloc_atomic and array of some class would be allocated with malloc
<RX14> @bew you can pass an initial size to IO::Memory iirc
<RX14> then use it as a buffer
<RX14> IO::memory.new(bytes); then use io.to_unsafe
<oprypin> probably wants to reuse the buffer
<FromGitter> <bew> @RX14 yeah but how to resize that buffer, if it's not big enough?
<RX14> why do you need that?
<RX14> and why not use slice/pointer?
<oprypin> yeah basically use slice..
<oprypin> easier to manually resize if it's not big enough than deal with the limitations
bmcginty has joined #crystal-lang
<RX14> you can create an IO::Memory from a slice if you need an IO interface
<FromGitter> <bew> yeah I use slice/pointer now ^^ I've seen the limitations of io memory, and seen that it's not what it's been built for!
<FromGitter> <bew> how to get the `SIZE_MAX` C macro, which is the max value of a `size_t` C type?
<FromGitter> <elorest> Sort of a silly question, but is there a way to map a hash to properties or @instance vars of an object at runtime. Obviously we don’t have send or eval. something like this but without eval. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5908f4c2f22385553d9abbfb]
<RX14> you'd need to use macros, why do you need this @elorest
<FromGitter> <elorest> I’m playing around with the idea of @db_object.set_attributes(:name => “me”, :age => 33) for an ORM.
<RX14> why not use named parameters
<FromGitter> <elorest> That’s probably the right solution.
<oprypin> bew, you can't do anything related to C preprocessor or header files. but Crystal maintains info about C types. use `LibC::SizeT::MAX`
<oprypin> >> LibC::SizeT::MAX
<DeBot> oprypin: # => 18446744073709551615 - https://carc.in/#/r/1yqa
<oprypin> wew the bot works
<FromGitter> <bew> ^^
<FromGitter> <bew> nice, ty! didn't thought to look for that
<FromGitter> <bew> nice number!
<oprypin> bew LibC::SomeType are just aliases to normal types, and for normal types there's this info available, that's in docs
<oprypin> >> LibC::SizeT
<DeBot> oprypin: # => UInt64 - https://carc.in/#/r/1yqb
<FromGitter> <bew> I saw the alias in lib_c/.../stddef.cr but didn't thought aboult looking at the aliased type...
<FromGitter> <bew> I shouldn't listen to a conference during coding^^ (no relation between the two!)
sp4rrow has joined #crystal-lang
Guest35405 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
Raimondii has joined #crystal-lang
zipR4ND1 has joined #crystal-lang
Aytan72 has joined #crystal-lang
zipR4ND has quit [Ping timeout: 260 seconds]
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
Philpax has joined #crystal-lang
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] bcardiff opened pull request #4367: [WIP] Add ThinLTO for LLVM >= 4.0 (master...thin-lto) https://git.io/v9R3T
<FromGitter> <MatthewBennington> Is there a way to get the next n bit in a file?
<FromGitter> <MatthewBennington> n bits*