ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.29.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
lucasb has quit [Quit: Connection closed for inactivity]
ashirase has quit [Ping timeout: 248 seconds]
ashirase has joined #crystal-lang
alex```` has joined #crystal-lang
alex``` has quit [Ping timeout: 246 seconds]
<FromGitter> <PlayLights_twitter> Is it ok to spawn fibers inside a fiber?
<FromGitter> <samueleaton> I just posted a question about merging NamedTuples in a macro if anyone knows how: https://stackoverflow.com/questions/56745416/how-to-merge-namedtuples-in-in-a-macro-in-crystal
<FromGitter> <Blacksmoke16> you'd have to create a new one with the properties from both
alex```` has quit [Ping timeout: 252 seconds]
<FromGitter> <Blacksmoke16> easiest solution here would be to use `JSON::Serializable` and inheritance
<FromGitter> <Blacksmoke16> @samueleaton
alex```` has joined #crystal-lang
<FromGitter> <samueleaton> @Blacksmoke16 That's a good idea. But I put this in a variable MAPPING so that i can do `JSON.mapping({{MAPPING}})` followed by `DB.mapping({{MAPPING}})` for dry-er code. Doing a JSON specific solution wouldn't be dry enough since i'd have to still do mapping for the DB table.
<FromGitter> <Blacksmoke16> not easier to just use an ORM?
<FromGitter> <Blacksmoke16> basically your problem is there is no `#merge` method
<FromGitter> <Blacksmoke16> prob could just do `JSON.mapping({{MAPPING}}, {{Thing::MAPPING}})`, is good enough
alex`` has joined #crystal-lang
<FromGitter> <Blacksmoke16> er no, sec
alex```` has quit [Ping timeout: 252 seconds]
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/74lc there we go
alex`` has quit [Ping timeout: 246 seconds]
alex`` has joined #crystal-lang
<FromGitter> <Blacksmoke16> @PlayLights_twitter are the values in your array static or altered at runtime?
<FromGitter> <samueleaton> @Blacksmoke16 I had no idea about that `double_splat`. verrrrry nice! And i don't like ORMs since I like SQL so much. :)
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/master/Crystal/Macros/NamedTupleLiteral.html#double_splat%28trailing_string%3AStringLiteral%3Dnil%29%3AMacroId-instance-method
<FromGitter> <Blacksmoke16> making a JSON API by chance? :p
<FromGitter> <PlayLights_twitter> @It is dynamic so i ended up refactoring my code
<FromGitter> <Blacksmoke16> πŸ‘
hightower2 has quit [Ping timeout: 244 seconds]
<FromGitter> <samueleaton> @Blacksmoke16 just selling cookies haha https://cravecookie.co/ ⏎ Been loving Crystal for this project. A little more trouble getting everything to compile with all the views and stuff but it pays off in run time.
<FromGitter> <PlayLights_twitter> Hey guys is it is possible to manually free memory used by an object?
<FromGitter> <Blacksmoke16> ah gotcha, good to hear
<FromGitter> <Blacksmoke16> you could manually call the GC
<FromGitter> <Blacksmoke16> however im not super familiar with this kinda stuff
<FromGitter> <watzon> @samueleaton just using Kemal?
<FromGitter> <PlayLights_twitter> @Blacksmoke16 i think i have saw code before using the GC but i don’t remember where
<FromGitter> <watzon> I have too
<FromGitter> <Blacksmoke16> afaik its just `GC.collect`?
<FromGitter> <watzon> I think you're correct. `GC.free` might be a thing?
<FromGitter> <watzon> Yeah it is as well
<FromGitter> <Blacksmoke16> might be able to do like `GC.free pointerof(my_obj)` then?
<FromGitter> <watzon> Possibly
<FromGitter> <watzon> You could also
<FromGitter> <watzon> `def self.free(pointer : Pointer(Void))`
<rkeene> Anyone know of a place that's hiring ? I know Crystal, if that helps :-D
<FromGitter> <watzon> Unfortunately for most places it doesn't
<FromGitter> <watzon> I got lucky
<FromGitter> <watzon> Hopefully once Crystal hits v1 we'll start seeing it in production more
sz0 has joined #crystal-lang
<rkeene> I also know dozens of other languages, as well as having done UNIX administration, and network administration, and built CI/CD systems, and designed and built a private cloud system (bare metal to cloud, automatically)
<rkeene> And I've built smartcard middleware, been a ("top 50") cryptocurrency lead developer, written software for everything from Flight Data Recorders (NIOS-II softcore), ESP32 IoT devices, ...
<FromGitter> <Blacksmoke16> i probably would have opened with that instead
<FromGitter> <Blacksmoke16> :p
<rkeene> Which one ?
<FromGitter> <Blacksmoke16> that sentance*
<rkeene> My smartcard middleware: https://cackey.rkeene.org/
<rkeene> (It supports Windows, Linux, macOS, HP-UX, Solaris, ChromeOS, FreeBSD, ... everything but MINIX)
<rkeene> I was the lead developer of Nano (https://nano.org/; Formerly RaiBlocks)
<rkeene> The software I wrote for the flight data recorders is closed source
<rkeene> So... any ideas, anyone ?
<FromGitter> <watzon> I'll let you know if I hear anything. You've worked with crypto?
<FromGitter> <Blacksmoke16> could always just check like indeed and stuff
<rkeene> Yes, both cryptocurrencies (lead developer for Nano and security audits on other cryptocurrencies) and cryptography (in addition to my smartcard middleware, I maintain a PKI stack for Tcl, and have talks on it)
<FromGitter> <watzon> That's cool. I'm helping out with the SushiChain project.
<FromGitter> <watzon> It's not a job yet though
<FromGitter> <watzon> Doesn't pay anything
ashirase has quit [Ping timeout: 272 seconds]
<FromGitter> <Blacksmoke16> Boo
<FromGitter> <watzon> Hopefully soon though
<FromGitter> <watzon> We're hoping to be funded sometime in the next 6 months
ashirase has joined #crystal-lang
<FromGitter> <watzon> Is the only way to merge two YAML files to turn them into hashes and merge then parse them back into YAML?
<FromGitter> <watzon> Trying to come up with a less convoluted way
<FromGitter> <Blacksmoke16> That's probably the easiest
<FromGitter> <Blacksmoke16> Do they have to be separate files?
<FromGitter> <Blacksmoke16> Can extend objects in yaml
<FromGitter> <watzon> Yeah. I have several potential config file paths and I want to load all of them and then merge them.
<FromGitter> <Blacksmoke16> Hmm
<FromGitter> <watzon> To make matters even more interesting I need to load values from env as well πŸ’©
<rkeene> Don't forget as CLI flags as well :-D
<rkeene> I wrote a library for this, a long time ago, called libconfig
<rkeene> It was before YAML existed, though, so doesn't support YAML
<FromGitter> <watzon> Ahh of course haha, I have to allow a hash of config options to be supplied as well for CLI flags
<rkeene> watzon, I also have a patent on the blockchain
<FromGitter> <watzon> That's pretty cool
<rkeene> And patching software, so... there's that
<FromGitter> <samueleaton> @Blacksmoke16 what was that `macro finished` in the code you shared earlier?
<FromGitter> <samueleaton> oh found it in the hooks page. https://crystal-lang.org/reference/syntax_and_semantics/macros/hooks.html
alex`` has quit [Ping timeout: 272 seconds]
alex`` has joined #crystal-lang
teardown has joined #crystal-lang
teardown_ has joined #crystal-lang
teardown is now known as Guest79354
teardown_ is now known as teardown
laaron has quit [Remote host closed the connection]
Guest79354 has quit [Quit: leaving]
laaron has joined #crystal-lang
<FromGitter> <watzon> Haha I got announcement 404 on Crystal-ANN
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <girng> hi
<FromGitter> <watzon> Hola
<FromGitter> <watzon> I just wrote a little script using octokit.cr and cleaned out almost all of my forked repos
<FromGitter> <watzon> Pretty much half of my repositories were forks
<FromGitter> <watzon> And this is all it took ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d11d665ae76db56e0430d8b]
devil_tux has joined #crystal-lang
sagax has quit [Ping timeout: 245 seconds]
alex`` has quit [Ping timeout: 246 seconds]
alex`` has joined #crystal-lang
<FromGitter> <yxhuvud> watzon: Hmm, you could rewrite to `repos.select &.fork`
<FromGitter> <yxhuvud> unless fork can be truthy but not wanted, I suppose.
DTZUZO has quit [Ping timeout: 245 seconds]
sagax has joined #crystal-lang
<FromGitter> <watzon> Yeah, I opted for the more explicit approach
<FromGitter> <watzon> But I could've done that
<FromGitter> <girng> why is &. called
<FromGitter> <girng> "The Safe Navigation Operator"?
<FromGitter> <watzon> Is it called that in Crystal? I know it is in Ruby.
<FromGitter> <girng> good lord
<FromGitter> <girng> they have an entire wiki for it https://en.wikipedia.org/wiki/Safe_navigation_operator
<FromGitter> <girng> `optional chaining operator` is what i like
<FromGitter> <girng> that makes sense to me lol
<FromGitter> <girng> wtf "safe navigation" lmaooo
<FromGitter> <girng> how is it safe, wehn the method could still fail, herp a derp
<jokke> well it's safe in the sense that it won't raise an error
<FromGitter> <girng> i guess it has diff usecases
<FromGitter> <girng> https://crystal-lang.org/api/0.27.0/Object.html#try%28%26block%29-instance-method
<FromGitter> <girng> > This method is useful for dealing with nilable types, to safely perform operations only when the value is not nil.
<FromGitter> <watzon> The idea is that you can avoid typing `if var1 && var2 && var3`
<jokke> but imho something like foo&.bar&.baz is a code smell
<FromGitter> <watzon> I like it better in Crystal
<FromGitter> <watzon> You have to use `try`
<jokke> watzon that's not the usecase
<FromGitter> <girng> i just did &.strip on an array, i
<FromGitter> <girng> i'm loving this &. lol
<FromGitter> <girng> should i say, `.map &.strip`
<jokke> its more like `var1 && var1.foo && var1.foo.bar`
<FromGitter> <watzon> Well yeah
<jokke> oh does crystal have `&.` as well?
<FromGitter> <girng> yah
<jokke> ooh
<jokke> ok
<jokke> but why?
<jokke> it already has try
<FromGitter> <watzon> It's not the same thing
<jokke> `foo.try(&.bar)`
<FromGitter> <girng> i think, for the optional chaining thing
<FromGitter> <watzon> You can't chain it like you can with Ruby
<FromGitter> <girng> lets you pass it inline
<FromGitter> <watzon> You have to do `article.try &.author.try &.name`
<jokke> yeah i see
<FromGitter> <girng> @watzon damn i never gone that far with chains
<jokke> which is good
<FromGitter> <girng> lol
<jokke> i think it's bad practice
<FromGitter> <watzon> Sometimes it's necessary
<FromGitter> <watzon> Especially when dealing with lots of nested JSON
<FromGitter> <girng> wait
<FromGitter> <girng> 1 sec gonna try something
<jokke> hmm
<jokke> i think using guard clauses would be cleaner
<jokke> author = article.try(&.author)
<jokke> return if author.nil?
<FromGitter> <girng> i like that
<FromGitter> <girng> easy to read
<jokke> it's more verbose but i think it's easyer to read, yeah
<jokke> because usually you just have one level where something can be nil. if that isn't nil the lower levels aren't nil either
<jokke> in that case name of the author
<jokke> the chaining of `&.` doesn't give you that information
<FromGitter> <girng> omg LOL
<FromGitter> <girng> gonna show this playground link 1 sec
<FromGitter> <watzon> It's very verbose and gets extremely annoying when you get 3 levels in
<FromGitter> <watzon> But it's all a matter of personal preference
<jokke> watzon then i think it's time to refactor the method that is doing all that
<jokke> but sure, personal preference too
<FromGitter> <watzon> If you have 3 nested JSON objects and you need to get a property on the third object there isn't much refactoring you can do. Your options are pretty much: use the short `prop.try &.other.try &.another`, or use the much more verbose syntax.
<FromGitter> <girng> https://play.crystal-lang.org/#/r/74ok/edit fiddling around. did not know you could chain methods in a &.
<FromGitter> <girng> lol awesomeeeeeeeeeee
<FromGitter> <girng> if sum1 has the time, i'm sure they could create some really weird looking crystal code hahaha
<FromGitter> <watzon> Lol yep
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
<FromGitter> <girng> in my baseball code golf challenge some of the submissions made my head explode
<FromGitter> <girng> ..and i thought i knew crystal pretty well
devil_tux has quit [Ping timeout: 252 seconds]
<FromGitter> <girng> just like in real life, there will always be someone bigger
<FromGitter> <girng> in programming, there will always be someone smarter
laaron has joined #crystal-lang
SukinoSenze has joined #crystal-lang
<FromGitter> <r00ster91> I'm getting an `SSL_connect: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed` error when connecting to a web socket URL, is there any way to just skip the certificate verification?
DTZUZO has joined #crystal-lang
SukinoSenze has quit [Remote host closed the connection]
devil_tux has joined #crystal-lang
alex`` has quit [Ping timeout: 272 seconds]
alex`` has joined #crystal-lang
devil_tux has quit [Ping timeout: 272 seconds]
<FromGitter> <Blacksmoke16> looks like i got some competition in the logger scene now @watzon :p
<FromGitter> <sirbroadwell> hi$
<FromGitter> <sirbroadwell> ```def id(x) ⏎ x ⏎ end``` ⏎ ⏎ How get type of id ? [https://gitter.im/crystal-lang/crystal?at=5d1215fff5b00456dfdd7d50]
devil_tux has joined #crystal-lang
duane has quit [Ping timeout: 272 seconds]
<FromGitter> <yxhuvud> `p typeof(id(x))` ⏎ ?
<FromGitter> <oprypin> it's a generic function, what do u mean
duane has joined #crystal-lang
<FromGitter> <girng> "or part of the type of an argument"
<FromGitter> <girng> wat
<FromGitter> <girng> *part of*??????????????
<FromGitter> <yxhuvud> @girng for example, `def foo(x); x.not_nil!; end` will strip some types (namely Nil) out of the type of x.
<FromGitter> <girng> ```foo(1) #=> Int32 ⏎ foo("hello") #=> String``` [https://gitter.im/crystal-lang/crystal?at=5d12226167887347a0873a0d]
<FromGitter> <girng> but it shows an Int32 and a String'
<FromGitter> <girng> what's in-between an Int32 and a String
<FromGitter> <girng> it's either a String for an Int32, how can a type be a part of something?
<FromGitter> <girng> `forall T` makes no sense
<FromGitter> <girng> goes against statically typed language values
<FromGitter> <girng> making a method dynamic
<FromGitter> <girng> wtf is this
<FromGitter> <dscottboggs_gitlab> @girng that's generics
<FromGitter> <dscottboggs_gitlab> it allows for dynamic typing as long as *all types are known at compile time*. Very important difference there.
<FromGitter> <girng> personally, i don't like that. shouldn't a method in a statically typed language, accept a statically typed input? and only that type?
<FromGitter> <girng> "known at compile time" but the developer still uses the method as a dynamic one lol
<FromGitter> <dscottboggs_gitlab> yes, but if the developer were to call the method on a type that won't work at any point in the method, the compiler will alert the developer *at compile time* instead of *at runtime*
<FromGitter> <girng> developer should create another method if they want a method to accept that type
<FromGitter> <dscottboggs_gitlab> Go is a decently nice language (well...not in terms of aesthetics lol) that has no support for generics
<FromGitter> <girng> why have 1 method be dynamic that's silly
<FromGitter> <girng> and prob leads to confusion
<FromGitter> <girng> and trouble finding bugs
<FromGitter> <dscottboggs_gitlab> yes, I use type restrictions almost all the time
<FromGitter> <girng> since this csv to to_i static parsing strick blacksmoke helped me with. i really like things statically typed
<FromGitter> <dscottboggs_gitlab> there was a really good example I saw the other day, but I can't find it now, and it was pretty short so I'll just write it here
<FromGitter> <girng> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d12250ff68cef3827c1d7c4]
<FromGitter> <girng> Why would @lucky_number have `| Nil` to it?
<FromGitter> <girng> Is it because it's not in the constructor?
<FromGitter> <girng> initialize section?
<FromGitter> <dscottboggs_gitlab> ```code paste, see link``` ⏎ ⏎ crystal does this by internally creating a new version of your function for each type of value that gets passed to it, and statically compiling all of those functions. [https://gitter.im/crystal-lang/crystal?at=5d1225da81d4c416606af513]
<FromGitter> <girng> wtf
<FromGitter> <Blacksmoke16> @girng yes, nor has a default value
<FromGitter> <girng> interesting
<FromGitter> <girng> > can take any type that has a + method defined on it.
<FromGitter> <dscottboggs_gitlab> because in the method I am calling `+` on the values
<FromGitter> <girng> yeah
<FromGitter> <girng> so.. if you were to do x : Int32
<FromGitter> <girng> it wouldn't work on the array right
<FromGitter> <girng> with the array*
<FromGitter> <dscottboggs_gitlab> yes
<FromGitter> <girng> ic, okay i can see it's usage then "can take any type that has a +"
<FromGitter> <girng> but imho, i'd rather create sum_array, or whatever
<FromGitter> <girng> have diff methods for what kind of types they interact with
<FromGitter> <girng> i guess it does that for you behind the scenes
<FromGitter> <Blacksmoke16> depends on the use case
<FromGitter> <Blacksmoke16> are some cases where you want a method to take any type of arg
<FromGitter> <girng> but yeah @dscottboggs_gitlab iknow that was just an example. ty for doing it
<FromGitter> <dscottboggs_gitlab> > i guess it does that for you behind the scenes ⏎ ⏎ Exactly, it's a shortcut. The more shortcuts, the better IMO :p
<FromGitter> <girng> ;D
<FromGitter> <girng> 6 more hours :/ then sleep fml
<FromGitter> <girng> i want to CODE ALL DAY
<FromGitter> <dscottboggs_gitlab> oof, sleep is super important
<FromGitter> <girng> true
<FromGitter> <vladfaust> Why `BigRational.new(Float32::NAN)` returns `-1024`?
<FromGitter> <vladfaust> Is there a way to have BigRational which represents NaN?
<FromGitter> <vladfaust> The answer is no, according to https://www.mpfr.org/faq.html
<FromGitter> <yxhuvud> Looks like something that should be an exception though.
<FromGitter> <tenebrousedge> @girng search through the crystal-lang source for "forall" for more uses
<FromGitter> <vladfaust> @yxhuvud I'm working with PG Numeric, and BigRational is the closest thing to it in Crystal
<FromGitter> <vladfaust> PG Numeric has NaNs though
<FromGitter> <yxhuvud> @vladfaust Well, an exception is probably more helpful in any case, as it alterts you that there is an issue. -1024 isn't very useful.
<FromGitter> <vladfaust> Ah, yes
lucasb has joined #crystal-lang
<FromGitter> <girng> @vladfaust working with some big numbers, eh? :D
rohitpaulk has joined #crystal-lang
<FromGitter> <mwlang> how do you write a JSON deserializer for JSON data that starts as an array? i.e. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d1239796d90fa3daa45c58e]
<jokke> Array(YourClass).from_json(json)
<FromGitter> <mwlang> I get the error: Expected begin_object but was begin_array
<FromGitter> <Blacksmoke16> can you make a playground link?
<FromGitter> <mwlang> sure, let me pull one together.
<FromGitter> <jreinert> or just use Array(YourClass).from_json(json)
<FromGitter> <girng> he might need help for the class ;p
<FromGitter> <Blacksmoke16> i mean that should be all you have to do, unless something else is going on
<jokke> ah ok
alex`` has quit [Ping timeout: 246 seconds]
<jokke> or better use struct instead of class if it's supposed to be immutable
alex`` has joined #crystal-lang
<FromGitter> <mwlang> I'm using class instead of struct because of additional behaviors I wanted to incorporate in the library generally.
<jokke> you can't use TradeResponses
<jokke> *Response
<jokke> just use Array(TradeEntry)
<jokke> there's no "trades" key anywhere. (because it's not even an object)
<FromGitter> <Blacksmoke16> yea dont really need that converter
<FromGitter> <mwlang> I'm working on a Binance API library: https://github.com/mwlang/binance
<FromGitter> <mwlang> and want all endpoints to return a ServerResponse or descendant.
<FromGitter> <mwlang> so....doing an Array(TradeEntry) breaks that model.
<jokke> if you really want to have TradeResponses just write the initialize(pull) and do what you do in the converter
<jokke> *TradeResponse
<jokke> just assign the result to @trades
<jokke> i hate apis that don't return objects
<FromGitter> <mwlang> me, too. :-/
<FromGitter> <mwlang> I guess the problem at hand, to handle this "unique" response that isn't a object like all the other endpoints....I need to modify the macro that's driving the whole process here: https://github.com/mwlang/binance/blob/master/src/binance/client/rest.cr#L33-L37
<jokke> well like i said
<jokke> just write the initializer
<FromGitter> <mwlang> ok, I'll give that a shot.
<jokke> then you can just keep everything as it is
<jokke> the macro i mean
<FromGitter> <mwlang> but the macro calls #from_json...wouldn't I need to know the JSON starts with "[" and thus an Array of objects and call #new instead of #from_json?
<jokke> from_json just calls the initializer
<jokke> so just write the initializer and it should "just work"
<FromGitter> <mwlang> ok, will do.
<jokke> basically your initializer just does `@trades = Array(TradeEntry).from_json(pull)`
<jokke> and that's it
<jokke> i'm not 100% certain though if your initializer will override the one generated by including JSON::Serializable
<jokke> but if you don't want to do `to_json` anyway you can just ditch that
<FromGitter> <mwlang> hard to believe, but it worked. https://play.crystal-lang.org/#/r/74r4
<FromGitter> <Blacksmoke16> nice one
<jokke> πŸ‘
rohitpaulk has quit [Remote host closed the connection]
<FromGitter> <kinxer> I'm finishing up a GeoJSON library in Crystal. Would it be confusing to name it something "clever" or should it just have a name related to GeoJSON (like "crGeoJSON")?
<FromGitter> <asterite> Nice! Clever or funny names are good. I guess it depends on whether you want the shard to be more discoverable... but with search engines it's not a real problem anymore
duane has quit [Ping timeout: 245 seconds]
<FromGitter> <kinxer> Unfortunately, crystals and gems don't seem to be very related to navigation or cartography, so I'm still working on what a clever name could be. I appreciate the input, though. I prefer fun names if possible.
_whitelogger has joined #crystal-lang
laaron has quit [Remote host closed the connection]
<FromGitter> <watzon> You sure do @Blacksmoke16 ;)
duane has joined #crystal-lang
<FromGitter> <Blacksmoke16> should have just made some PRs :P are quite similar
<FromGitter> <Blacksmoke16> concept wise
<FromGitter> <jwoertink> If I wanted to gzip my static assets, would the `HTTP::CompressHandler` come after the `HTTP::StaticFileHandler`?
<FromGitter> <jwoertink> It looks like if the static file `is_file` then it doesn't call `call_next` https://github.com/crystal-lang/crystal/blob/fbfe8b62f44eca4596090b7580801bd184f73c7a/src/http/server/handlers/static_file_handler.cr#L78
<FromGitter> <jwoertink> so it seems like it would never hit the gzip handler
<FromGitter> <jwoertink> but if you put the compression before the static, then it wouldn't actually compress the file, right?
<FromGitter> <Blacksmoke16> prob not
<FromGitter> <mwlang> @kinxer how about "sextant" ?
<FromGitter> <Blacksmoke16> could just reopen the static file handler and add the compressions stuff
<FromGitter> <kinxer> @mwlang That's pretty good. I was thinking of "geode", which only has a couple of direct matches on GH.
<FromGitter> <tenebrousedge> I like "geode"
<FromGitter> <kinxer> Ideally I'd get something about the serialization in the name, but I don't think that's gonna be feasible (at least, not with a reasonably short name).
<FromGitter> <tenebrousedge> but what about those sunstones the Vikings used
<FromGitter> <tenebrousedge> "There are only two hard problems in Computer Science: cache invalidation, naming things, and off-by-one errors."
<FromGitter> <kinxer> `SunStone` is a good name, though.
<FromGitter> <asterite> about gzip and static handler, it's probably something to fix in the std
<rkeene> Sunstone is the name of the OpenNebula Web-based UI
<FromGitter> <vladfaust> I've got some magic going on here ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ How is it even possible? These are identical slices :thinking: [https://gitter.im/crystal-lang/crystal?at=5d12684ab03bdb2931052763]
<FromGitter> <Blacksmoke16> sec
<FromGitter> <Blacksmoke16> https://github.com/crystal-lang/crystal/issues/7894 prob related to this @vladfaust ?
<FromGitter> <watzon> Glad I'm not the only one with issues relating to `to_slice`
<FromGitter> <vladfaust> Damn it
<FromGitter> <vladfaust> It looks somewhat similar, yeah
<FromGitter> <vladfaust> Do you know how to fix it, @Blacksmoke16?
<FromGitter> <Blacksmoke16> its fixed in master
<FromGitter> <vladfaust> w/o crystal master
<FromGitter> <Blacksmoke16> ah
<FromGitter> <Blacksmoke16> try `.dup` your slice
<FromGitter> <Blacksmoke16> so it gets copied to its own memory space
<FromGitter> <Blacksmoke16> :shrug:
<FromGitter> <vladfaust> Nope, can figure it out. That's funny to see completely random values every time
<FromGitter> <vladfaust> 1) By "funny" I mean I wanna crush everything
<FromGitter> <Blacksmoke16> i doubt master would fix it, since the issue was specific to UUIDs
<FromGitter> <vladfaust> Well, need to find another way to encode ints into bytes
<FromGitter> <Blacksmoke16> but they prob share the same core issue
<FromGitter> <Blacksmoke16> imagine thats what the LibPQ is doing already tho...
<rkeene> Also, OpenNebula is Ruby based and they considered moving to Crystal
<rkeene> I couldn't convince them to move to Tcl
<FromGitter> <vladfaust> > imagine thats what the LibPQ is doing already tho... ⏎ ⏎ It should not matter. It accepts `Bytes` as argument, so what the hell
<FromGitter> <vladfaust> > https://crystal-lang.org/api/master/IO/ByteFormat.html ⏎ ⏎ Yes, `LibPQ::ByteFormat` is alias to BigEndian
<FromGitter> <Blacksmoke16> interesting
<FromGitter> <vladfaust> The best part is `== Bytes[0, ..., 0]` the fuck
<FromGitter> <vladfaust> Well, I guess it `StaticArray` problem
<FromGitter> <vladfaust> Maybe the fact that it's in stack causes the issue
<FromGitter> <vladfaust> This works: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d126be187ca0b48c4972e52]
alex`` has quit [Ping timeout: 244 seconds]
<FromGitter> <vladfaust> BTW, for encoding into bytes, using `StaticArray` is pointless, because we still use slices (which are always in heap)
alex`` has joined #crystal-lang
<FromGitter> <r00ster91> when spawning multiple fibers in a method and then `return`ing inside of one of the fibers, then all other fibers stop running too, right? Or do they continue running even after the `return`?
<oprypin> continue
<FromGitter> <r00ster91> ooh
<FromGitter> <r00ster91> thats good to know
devil_tux has quit [Ping timeout: 268 seconds]
<FromGitter> <watzon> I can't wait for multithreading support
<FromGitter> <watzon> I mean fibers are great and all
<FromGitter> <watzon> But true parallelism would be nice
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d1295d60f05173826123ebc]
<FromGitter> <Blacksmoke16> 😬 :P
<FromGitter> <watzon> Lol I know I know
<FromGitter> <watzon> Tests are coming
<FromGitter> <watzon> Right after I publish this web scraping project
<FromGitter> <Blacksmoke16> what are your plans for it? seems silly having two things that are pretty much the same
<FromGitter> <Blacksmoke16> unless you going to go a different direction or something
<FromGitter> <watzon> More than anything I like to have that flexibility. I also didn't notice that your logger had the idea of formatters and such.
<FromGitter> <Blacksmoke16> yea, and processors/context
<FromGitter> <Blacksmoke16> esp since yours also allows multiple loggers to have their own stuff
<FromGitter> <Blacksmoke16> kinda based our stuff off similar frameworks haha
<FromGitter> <watzon> Yeah I guess so. I noticed you based yours off of a PHP logger, so I didn't really bother looking at the one you based it off in any more depth. I kind of hate PHP just a little.
sagax has quit [Write error: Connection reset by peer]
<FromGitter> <Blacksmoke16> hehe
<FromGitter> <watzon> On an unrelated note, I'm testing my web scraper on pornhub right now πŸ˜‚
<FromGitter> <watzon> It's working fantastically
<FromGitter> <watzon> Oh the flexibility you have when working from home
<FromGitter> <Blacksmoke16> my pipe dream is some framework with formatters/processors/handlers be defined in the stdlib
<FromGitter> <Blacksmoke16> which would define the basic ones and the API
<FromGitter> <watzon> That would be wonderful, but definitely a pipe dream
<FromGitter> <Blacksmoke16> then shards could define them
<FromGitter> <Blacksmoke16> other projects could use them, everything would just work
<FromGitter> <watzon> Well maybe once the stdlib gets split apart into different shards the core devs will be open to that
<FromGitter> <Blacksmoke16> i got a +1 on my comment on the improve logger issue
<FromGitter> <Blacksmoke16> ill take that as #progress
<FromGitter> <watzon> Hahaha
<FromGitter> <watzon> Link me to it
<FromGitter> <watzon> I'll give you another
<FromGitter> <Blacksmoke16> however im unsure if thats something they actually want, or just agree with my pipe dream πŸ˜†
<FromGitter> <watzon> Yeah. I feel like we need some kind of voting system for ideas. Right now everything is up to the core devs, and they tend to disagree a lot with the community and among themselves.
<oprypin> this is one of those cases where democracy doesnt work
<oprypin> the voting would be disproportionately affectionate to what already exists in ruby, whether it makes sense or not
<oprypin> (yes, im a hater, w/e)
<FromGitter> <watzon> Why do you say that? Obviously core devs need to have the final say, because sometimes people are just stupid, but if the community as a whole thinks that something should exist or not exist then I feel like that should influence their decisions
<oprypin> tbh i'd just let asterite decide everything, but then again, i think he was feeling overburdened by exactly that
<oprypin> watzon, i feel that github issues, reactions and even normal replies handle the part of "influencing decisions" fine
<rkeene> What Tcl does maintain a set of common packages outside of the Tcl core, then at release time they'll be included in the release in such a way they are built with the Tcl core
<oprypin> python has exactly 1 package like that :D - pip / ensurepip
alex`` has quit [Ping timeout: 252 seconds]
<rkeene> Tcl has a few: SQLite3, Database stuff, the OO package, the thread package
<FromGitter> <ezrast_gitlab> @Blacksmoke16 Did you see my PR for that issue you commented on? I think it does a lot of what you're asking for (super simple interfaces for filter/emitter that you can slot your own handlers into) but it's been pending review since October.
asterite has quit [Ping timeout: 245 seconds]
jhass has quit [Ping timeout: 250 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
asterite has joined #crystal-lang
jhass has joined #crystal-lang
_whitelogger has joined #crystal-lang
ashirase has quit [Ping timeout: 244 seconds]
ashirase has joined #crystal-lang
ashirase has quit [Ping timeout: 252 seconds]
ashirase has joined #crystal-lang
<FromGitter> <watzon> @ezrast_gitlab it