<FromGitter>
<Blacksmoke16> where im giving it two files, one with `---\name: Jim` the other with `\nname: Bob`
<FromGitter>
<Blacksmoke16> yet it seems it doesnt parse the yaml like they have both names?
<FromGitter>
<Blacksmoke16> oh
<FromGitter>
<Blacksmoke16> the 2nd one overrides the first key, :facepalm:
<FromGitter>
<Blacksmoke16> thanks for being my duck
<FromGitter>
<bajro17> is there any book about crystal except this from Ivo Balbaert or video tutorial on udemy or any other website for video tutorials
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
olbat[m] has quit [Remote host closed the connection]
watzon[m] has quit [Write error: Connection reset by peer]
olbat[m] has joined #crystal-lang
devil_tux has quit [Ping timeout: 272 seconds]
<FromGitter>
<girng> hi
<FromGitter>
<girng> @Blacksmoke16 :D
<FromGitter>
<j8r> How I can create an empty NamedTupleLiteral?
<FromGitter>
<cfsamson> Ok, so guys. I'll try again here since it's a new day, but have anyone tried to cross-compile the "hello world" example from the Wiki: https://github.com/crystal-lang/crystal/wiki/Porting-to-Windows on version 0.29? You don't need Windows to try this out since I get a compilation error when cross compiling from ubuntu passing in `crystal build --cross-compile --target x86_64-pc-windows-msvc hello_world.cr`
<FromGitter>
... complaining that `Fiber`is undefined. I have a pretty good feeling that this is caused by some changes made the last 3-4 months but would love if someone could confirm that they get the same error so it's not only me.
<FromGitter>
<bew> RX14 would be able to answer I think
<FromGitter>
<cfsamson> @RX14 Do you get this working on 0.29? I have gathered some more information about this but just want to rule out that there is an error on my part before spending a lot of time chasing down the wrong rabbit hole (which is very possible but I get this both using the prebuilt binary and when compiling from source) - seems to be mostly related to changes made the last 2-4 months.
<FromGitter>
<j8r> @Blacksmoke16 maybe you have an idea of how to create an empty NamedTupleLiteral?
<FromGitter>
<watzon> @j8r I'm not sure you can. Why would you wan't to?
<FromGitter>
<j8r> I've found a workaround somehow
<FromGitter>
<bew> @j8r then you need to change the initial macro call to `A.mac(a: 1)` instead of `A.mac({a: 1})` and it works.... But you get an infinite loop ^^
<FromGitter>
<j8r> 👍
<FromGitter>
<j8r> For creating a NamedTupleLiteral,I 've created a HashLiteral then I've looped inside it to transform it.
<FromGitter>
<bew> Looks weird.. ^^
devil_tux has quit [Ping timeout: 268 seconds]
<FromGitter>
<girng> NamedtupleLiteral?
<FromGitter>
<girng> Is this a new class/type? i never heard of it
<FromGitter>
<bew> It's the type NamedTuple in macros
<FromGitter>
<dscottboggs_gitlab> yes ` : String?` is a type restriction for that variable which says that it is either a `String` or `nil`
<FromGitter>
<girng> nice
<FromGitter>
<girng> that felt good :p
<FromGitter>
<girng> i wias first looking at it and was like wtf
<FromGitter>
<girng> maybe brain fart, iuno
laaron- has joined #crystal-lang
<FromGitter>
<dscottboggs_gitlab> haha
<FromGitter>
<dscottboggs_gitlab> @cfsamson the reason you can't compile the hello world is that every crystal program (even a hello-world) comes with an event look and some other extras for the GC and whatnot
<FromGitter>
<dscottboggs_gitlab> I ran @cfsamson's command but with `-D gc_none` and received this output: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I'm assuming the output is a command I need to run on windows to compile the object file into an executable. What is this `cl` command on windows and is there an equivalent command I can run from wine or linux? [https://gitter.im/crystal-lang/crystal?at=5d160afa490abf627a337de8]
<FromGitter>
<cfsamson> @dscottboggs_gitlab OK, but did you get the same error when not compiling with `-D gc_none`? You're right, on Windows you link to gc.lib and pcre.lib to make an executable.
<FromGitter>
<cfsamson> OK, so I guess that's the solution. Will try to link and compile it on windows and see if it works then.
<FromGitter>
<cfsamson> That makes sense, but I would have thought that following the Wiki should work...
<FromGitter>
<dscottboggs_gitlab> I agree.
<FromGitter>
<cfsamson> Thanks for helping out though!
<FromGitter>
<dscottboggs_gitlab> looking through `boehm.cr` it looks like they intend it to work under `win32`, so I would suggest opening an issue regarding this
devil_tux has joined #crystal-lang
duane_ has joined #crystal-lang
<FromGitter>
<cfsamson> Yeah, it looks like it. I'll spend a little bit of time on this now that I know I was not the only one getting that error.
duane has quit [Ping timeout: 258 seconds]
<FromGitter>
<dscottboggs_gitlab> I compiled a version of the compiler with that taken out, like so, and it built the object. I don't have access to a windows box right now so I can't test if it works though, and I think it will lead to other bugs if you try to use fibers on windows
<FromGitter>
<dscottboggs_gitlab> the module `Fiber` (in *fiber.cr* `require`s `"thread/linked_list"`, which requires `"thread/mutex"`, which requires "c/pthread" unconditionally. That won't work on windows.
duane_ has quit [Ping timeout: 246 seconds]
duane has joined #crystal-lang
<FromGitter>
<cfsamson> Yes, I'm actually working on a branch aiming to improve windows support for fibers, so I haven't worked on the master branch to debug this. However I concluded the same as you that there is a problem with `c/pthread` on windows. If you look in the `src/libc/ x86_64-windows-msvc` that's not that strange and I think the intention is to use "something" else than `pthread` since that is a POSIX threading API that
<FromGitter>
... won't work on windows anyway. ⏎ ⏎ However I struggle to see where they conditionally compile the C api they use. I see there are platform specific bindings in `std/lib_c` folder but I have no idea how the conditional compilation is designed. Do you have any idea?
duane has quit [Ping timeout: 246 seconds]
<FromGitter>
<mistergibson> Seems like they will have to devote a significant amount of time / energy to a platform abstraction layer internally.
<FromGitter>
<mistergibson> threads are one area, then there is file system, networking, etc
<FromGitter>
<bew> @mistergibson we already have that with `Crystal::System::*`, just not for everything yet..
<FromGitter>
<bew> Check in `src/crystal/system/`
<FromGitter>
<mistergibson> ah ok -- cool
<FromGitter>
<mistergibson> In my ruby stuff I created an extensive System object: FSInfo/Networking/CPUinfo/ProcessInfo/MemoryAllocation
<FromGitter>
<mistergibson> down to the cpu flags available
<FromGitter>
<mistergibson> We will need this in Crystal as well
<FromGitter>
<mistergibson> rkeene: I'm not so sure Ruby is dead dead. Maybe it is only half-dead. I mean: I use Opal.rb in the browser and it allows me to barely even touch javascript. I use Ruby for my web servers (NOT RAILS) and it does just fine. It is not in vogue anymore per se, but I suspect that languages like Crystal will bring it back in unusual ways.
<FromGitter>
<mistergibson> Crystal will be the C++ for Ruby folks I suspect
<FromGitter>
<mistergibson> I love it because it represents the features of C++ w/o the brain damage
<FromGitter>
<mistergibson> As for Ruby : I have not found a more elegant language that steals the best features from Smalltalk, LISP, Perl, etc in one place.
<FromGitter>
<mistergibson> Ah the venerable Tcl - yes
<rkeene>
Yep, Ruby and Tcl, together :-)
<FromGitter>
<mistergibson> I think Ruby is in regrouping mode with the projects I've mentioned
<rkeene>
Tcl has all those things and more
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
<FromGitter>
<AmberSaber> Many programming languages have been born based on the llvm platform, and llvm is like a programming language pipeline. Perhaps such a tool will appear some time later. You just need to say some features of the programming language you want to design. Then you don't have to do anything, don't think about anything, the computer sounds a few times, then a programming language named with your name is
<FromGitter>
... born.
duane has quit [Ping timeout: 272 seconds]
laaron has joined #crystal-lang
laaron- has quit [Remote host closed the connection]
_whitelogger has joined #crystal-lang
alex`` has joined #crystal-lang
<FromGitter>
<watzon> @vladfaust that's not a bad idea
greengriminal has joined #crystal-lang
<FromGitter>
<wontruefree> is there a library for cidr bases ip addresses?
<rkeene>
Especially what would otherwise be tedious things like subtraction, so you could compute 1.2.3.0/24 -1.2.3.4 to get 1.2.3.0/30 1.2.3.5/32 1.2.3.6/31 1.2.3.8/29 1.2.3.16/28 1.2.3.32/27 1.2.3.64/26 1.2.3.128/25
<FromGitter>
<watzon> Shouldn't be too hard to make a crystal shard that's similar
<rkeene>
And add subtraction
<FromGitter>
<girng> If the GC is disabled in Crystal. Does this mean, each time a class is initialized, we will have add a memory deallocation to its constructor?
<FromGitter>
<girng> deconstructor**
<FromGitter>
<girng> But wait, how does Crystal know an object is going to die without a GC
<FromGitter>
<watzon> Who's talking about removing the GC? The only way to not have a GC would be to do what Rust does.
<FromGitter>
<girng> > I compiled a version of the compiler with that taken out
<FromGitter>
<wontruefree> I want to detect overlaps of cidr know if an ip is in a cidr range
<FromGitter>
<girng> i was just scrolling up and saw why
<FromGitter>
<Blacksmoke16> he was trying to get it to compile on windows
<FromGitter>
<girng> but why
<FromGitter>
<wontruefree> I guess detecting overlaps is not that hard
<FromGitter>
<Blacksmoke16> to work on implementing FIbers
<FromGitter>
<wontruefree> but I still want to know if an IP is inside a cidr
<FromGitter>
<Blacksmoke16> otherwise it just doesnt compile
<FromGitter>
<girng> wait, boehm doesn't compile on windows?
<FromGitter>
<girng> > I love it because it represents the features of C++ w/o the brain damage ⏎ ⏎ :D
<FromGitter>
<watzon> How can I do what ruby does with `Array#pack(" B*")`?
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter>
<watzon> @kinxer what don't you like?
<FromGitter>
<Blacksmoke16> i wouldn't be surprised if there is a shortcut to that tho
<FromGitter>
<watzon> I wouldn't either
<FromGitter>
<watzon> There must be
<FromGitter>
<kinxer> It's just a weird little domain language for converting string contents between byte representations?
alex`` has joined #crystal-lang
<FromGitter>
<kinxer> It's just very arcane.
<FromGitter>
<girng> looks confusing af
<FromGitter>
<kinxer> Yeah, that's basically what I was trying to say.
<FromGitter>
<girng> i'm with you, i don'tl ike it either
<FromGitter>
<girng> reminds me of the brain f-word language
<FromGitter>
<girng> lol
<FromGitter>
<watzon> Brainfuck?
<FromGitter>
<watzon> Lol
<FromGitter>
<girng> yah hahahaha
<FromGitter>
<girng> i've seen codegolf solutions of people using that on stackoverflow
<FromGitter>
<girng> like wtf.....
greengriminal has joined #crystal-lang
<FromGitter>
<mwlang> Is the "./src" folder built into the shard library hard-coded or is it something easily changed?
<FromGitter>
<watzon> You can use whatever folder you want
<FromGitter>
<mwlang> oh, and I guess that begs the next question of convention over configuration...is this a strongly followed convention we're discouraged from changing or just happens to be what I see in the roughly 10 or so shard sources I've reviewed to-date?
<FromGitter>
<watzon> `./src` is just a convention
<FromGitter>
<watzon> If you don't have a good reason to change it I wouldn't
<FromGitter>
<Blacksmoke16> id bet 99% of shards use `src`
<FromGitter>
<mwlang> well, I'm just so used to "app" and "lib" containing my sources from Ruby projects.
<FromGitter>
<Blacksmoke16> :p
<FromGitter>
<mwlang> I keep "automatically" expanding "lib" to look for my code.
<FromGitter>
<mwlang> old habits die so hard.
<FromGitter>
<Blacksmoke16> can still do that after you install shards
<FromGitter>
<mwlang> esp. daily ones of 10+ years.
<FromGitter>
<watzon> Haha yeah you definitely can't use lib though
<FromGitter>
<watzon> That's where other shards get installed so that would fuck everything up
<FromGitter>
<mwlang> well, we don't want that.
<FromGitter>
<Blacksmoke16> er but, shouldnt commit lib dir so ofc only when first installing it
<FromGitter>
<Blacksmoke16> when installing locally*
<FromGitter>
<mwlang> not gonna mess with lib folder...was really only thinking to rename the src folder "app" so it's at top of the tree.
<FromGitter>
<Blacksmoke16> give it a try
<FromGitter>
<mwlang> so weird having my spec folder come *before* my source
<FromGitter>
<Blacksmoke16> or just get used to it :P
<FromGitter>
<mwlang> you're the master of of "do it or don't do it, it's up to you" 😆
<FromGitter>
<mwlang> I'll just keep on trying to break the habit...that 99.995% comment above convinces me since I ain't a betting person -- at least not this bet, anyhow.
<FromGitter>
<Blacksmoke16> sounds like a plan
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter>
<mwlang> making good progress on the binance api wrappers. Got that whacky 2D array response wrapped succinctly.