<FromGitter>
<markrjr> I'm getting an unresolved symbol error when trying to create a binary on Windows. I'm following the instructions in the porting to Windows guide.
<FromGitter>
<markrjr> SystemFunction036?
<FromGitter>
<markrjr> Which comes from here I think?
<FromGitter>
<markrjr> I used the latest Crystal 26.1 on Fedora to cross compile.
<FromGitter>
<markrjr> Is there a special branch that I should use of crystal compiled from source?
baweaver_away is now known as baweaver
<FromGitter>
<markrjr> Figured it out!
<FromGitter>
<markrjr> Just gotta add that to the command line when linking: `"hello_world.o" "/Fehello_world" pcre.lib gc.lib libcmt.lib advapi32.lib`
<FromGitter>
<Sija> Marxism v2.0? Brave New World is here, huh. 100 kudos to @asterite for keeping these issues out of the codebase!
<FromGitter>
<SeedyROM> Is there anyway to tell YAML.parse to parse all key value pairs as strings? I'm trying to parse a file that is always going to be different. And figuring out stuff with YAML::Any is so annoying. Maybe I'm missing something important here.
<FromGitter>
<girng> what is going on
<FromGitter>
<girng> why do they pick crystal as a target
<FromGitter>
<Sija> @SeedyROM I think `YAML::Schema::FailSafe.parse` is what you’re looking for
<FromGitter>
<girng> @markrjr btw, congrats haha
<FromGitter>
<SeedyROM> @Sija Let me check it out! Thanks for pointing that out, I must have glanced over that.
lvmbdv has quit [Quit: Connection closed for inactivity]
<FromGitter>
<SeedyROM> @Sija, now upon loading the YAML document I get this error:
<FromGitter>
<SeedyROM> ```undefined method 'first?' for YAML::Any```
<FromGitter>
<Sija> @girng popularity? name? ask them next time you’ll have a chance (that is before someone hopefully will lock the issue) ;) I’d be interested to know the answer too! maybe it’s a sign of success - Crystal is known enough to make ideological brute-force attacks
<FromGitter>
<SeedyROM> It happens in the cast_document call of the parser, which implies a singular doc. Atleast that's what I'm getting out of the context of the error.
<FromGitter>
<SeedyROM> I know it doesn't have a first, but cast_document is not getting passed a list.
<FromGitter>
<Blacksmoke16> ohh its happening *from* the parse
<FromGitter>
<Blacksmoke16> my bad, i follow you now
<FromGitter>
<Blacksmoke16> prob would help if you posted the yaml in the config file too
<FromGitter>
<SeedyROM> I did.
<FromGitter>
<SeedyROM> It's super basic.
<FromGitter>
<Blacksmoke16> i mean in the issue*
<FromGitter>
<Blacksmoke16> cheers 👍
<FromGitter>
<SeedyROM> :cheers:
<FromGitter>
<SeedyROM> Lol, I don't know how these gitter emoticons work.
<FromGitter>
<Blacksmoke16> only some of the ;)
<FromGitter>
<SeedyROM> I think I just need to be more light handed with my handling of types, I was trying aggressively to get the YAML module to work like it would in a dynamically typed language.
<FromGitter>
<SeedyROM> I think I've been getting spoiled by how most of the time the type system is pretty much hidden.
<FromGitter>
<Blacksmoke16> usually afaik, the rule of thumb is to get away from the `YAML::Any` asap and into like an array of objects or something
<FromGitter>
<Blacksmoke16> can be helpful as well
<FromGitter>
<SeedyROM> I was playing around with that early but couldn't get it to work the way I intended it to, but I'm realizing now I was just being impatient.
<FromGitter>
<SeedyROM> I need to think more about how I want this to work.
<FromGitter>
<Blacksmoke16> thats usually a good first step haha
<FromGitter>
<SeedyROM> I had a good plan for everything else, but I totally messed up on the parsing YAML part haha
<FromGitter>
<Blacksmoke16> is always something
rohitpaulk has joined #crystal-lang
<FromGitter>
<markrjr> How do I compile to test the new functionality for Windows?
<FromGitter>
<markrjr> That includes `c/winnt` etc. so that it can get definitions for DWORD and other stuff.
<FromGitter>
<markrjr> Do I have to compile the entire compiler?
<FromGitter>
<markrjr> Or should I just drag c/winnt and whatever else I include into the same directory, compile those, and then try to compile/link on Windows?
<FromGitter>
<codenoid> i got the epoch from Android SMS
<FromGitter>
<codenoid> READ_SMS
<FromGitter>
<Timbus> Epoch time is in seconds.. You're using, I guess.. milliseconds
<FromGitter>
<codenoid> idk, android give me that epoch
<FromGitter>
<Timbus> Java uses millisecond epoch
<FromGitter>
<codenoid> so,,,,
<FromGitter>
<Timbus> divide by a thousand, I guess
<FromGitter>
<codenoid> <3
<FromGitter>
<HarrisonB> @markrjr agreed about the trolls just being trolls... i mean one of their icons was an anti-black caricature and another was two non-white stick figures stomping on a white stick figure. feels like they're just trying to stir up racist sentiments after the recent leader/follower controversy
rohitpaulk has quit [Ping timeout: 244 seconds]
<FromGitter>
<rishavs> I am really struggling with ECRs. code which should work is not working and I can't find any error. Spent the entire weekend on a single error which I could not fix. :/ I really can use some help. ⏎ I am calling my ECR render like this; ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5ba87ff5e6046343f3a942f5]
rohitpaulk has joined #crystal-lang
ddffg has joined #crystal-lang
<FromGitter>
<codenoid> but yeah
<FromGitter>
<codenoid> sorry, wrong room
Liothen has quit [Quit: The Dogmatic Law of Shadowsong]
Liothen has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 246 seconds]
<FromGitter>
<rishavs> If i use the same bit of code in a different route, it works.
ddffg has quit [Remote host closed the connection]
<FromGitter>
<bajro17> I will try it @rishavs
<FromGitter>
<rishavs> thanks! <3
ua has quit [Ping timeout: 260 seconds]
<FromGitter>
<sdogruyol> Morning everyone 👋
<FromGitter>
<bajro17> @sdogruyol Good morning dear brother :)
<FromGitter>
<rishavs> @bajro17 I just found the issue. Thanks for trying to help me out
ua has joined #crystal-lang
<FromGitter>
<rishavs> I am referring to the same ECR in two places and in the 2nd place, i didnt initialize the variable that I was trying to show in there. And all this time i was focussing on the 1st instance of the ECR reference and never checked the 2nd.
<FromGitter>
<bajro17> No problem glad you fix it :)
rohitpaulk has joined #crystal-lang
moei has quit [Quit: Leaving...]
<FromGitter>
<drum445> @Sija agreed that it's Marxism reborn, Huxley is weeping
<FromGitter>
<drum445> good morning @sdogruyol, what's new?
<FromGitter>
<sdogruyol> @drum445 thank you, not much I guess :) How about you?
<FromGitter>
<drum445> Not too much, creating an app (not quite thought of the idea yet) but it will use encryption with sqlite
<FromGitter>
<sdogruyol> Sounds good 👍
<FromGitter>
<bajro17> Haaahhahah @rishavs I try now play with ECR and dont work at all I cant figure out how to use ECR.render macro
<FromGitter>
<rishavs> yeah. ECRs have been a lot of pain. But that seems true of all macros. Thankfully, once I am able to fix any problem around ECRs they stay fixed. And most problems are because of my own mistakes.
<FromGitter>
<bajro17> do you have any example how to use ecr.render
<FromGitter>
<bajro17> it give me error like this
<FromGitter>
<bajro17> @instance_vars are not yet allowed in metaclasses: use @@class_vars instead
<FromGitter>
<bajro17> sorry
<FromGitter>
<bajro17> I'm stupid hahahah
<FromGitter>
<bajro17> I dont notice I have @variable instead just variable
<FromGitter>
<bajro17> JesseH are you try to use this text field? are you get any error
return0e has joined #crystal-lang
<JesseH>
bajro17 when I use granite migrator to create the tables, String types default to VARCHAR(255)
ashirase has quit [Ping timeout: 260 seconds]
<FromGitter>
<bajro17> JesseH I dont have mysql installed now to test it
<FromGitter>
<bajro17> can you please write me how your command looks like
ashirase has joined #crystal-lang
<FromGitter>
<vladfaust> @rishavs that's not fun at all
ua has quit [Ping timeout: 264 seconds]
rohitpaulk has joined #crystal-lang
ua has joined #crystal-lang
moei has joined #crystal-lang
ua has quit [Ping timeout: 245 seconds]
ua has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 252 seconds]
<FromGitter>
<bajro17> Is anyone know is there for crystal IPFS library?
<FromGitter>
<eliasjpr> does shards support monorepo style of shards?
Groogy1 has quit [Ping timeout: 252 seconds]
rohitpaulk has joined #crystal-lang
Groogy1 has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 272 seconds]
<FromGitter>
<rishavs> Is there a simple way to convert an array of strings`["nature", "science", ...]` into a string with format `"('nature'), ('science'), ..."`? ⏎ Currently I am iterating over the list and adding each item into the formatted string one by one. it seems like there should be a better way to do it.
<FromGitter>
<bew> @eliasjpr means subdirectories of a github repo, not local
<FromGitter>
<bew> (@j8r ^)
<FromGitter>
<j8r> remote repo? not possible
<robacarp>
the big reason ruby gems supports this is that rubygems uses their own central server to publish gems rather than depending on github to do it
ua has quit [Ping timeout: 240 seconds]
ua has joined #crystal-lang
<FromGitter>
<eliasjpr> I think having shards to support monorope is a fair use case, specially for institutions who uses monorepo and have might have a bunch of shards.
<FromGitter>
<girng> is there a way to dynamically set which ones to exclude?
<FromGitter>
<r00ster91> not really, no
<Heaven31415>
so it's possible to create your own std and work without the default one
<FromGitter>
<r00ster91> @girng ⏎ but heres another tip if you want your own code to compile fast: you shouldnt use the `Int` type restriction on arguments in your methods because this: ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5ba91673b9531f2dfab44745]
<FromGitter>
<girng> Interesting. So it's safe to say, the more specific your code is, the faster it will compile?
<FromGitter>
<girng> yeah, I've never really used just plain `Int` before, but I've been using Int8 and Int64 a bit. for mapping types from database
rohitpaulk has quit [Ping timeout: 252 seconds]
<FromGitter>
<r00ster91> > Interesting. So it's safe to say, the more specific your code is, the faster it will compile? ⏎ Hmm no im not too sure about that. IIRC I once made a compilation time test with 1000 times this method: ⏎ ⏎ ```def method(arg : String) : Nil ⏎ end``` ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5ba91a76913ba7799b39b335]
Groogy1 has quit [Ping timeout: 240 seconds]
<FromGitter>
<girng> i want to write an app in either crystal with a small gui library, or use godot. but i want it to to execute 2 commands with 1 click, or click on each button for that specific command to be run. cmd 1: `crystal src/MasterServer.cr` , cmd2 : `crystal src/GameServer.cr`. this would be very beneficial because i'm getting really annoyed of alt-tabbing, or switching to 2 separate console windows when developing
<FromGitter>
<r00ster91> are you on windows?
<FromGitter>
<girng> yeah, W10
<FromGitter>
<girng> @r00ster91 yeah i'll check my code to see and try to change Int to its specific type
<FromGitter>
<fridgerator> You could use docker-compose, you could try Sentry to auto-reload your changes, you could write a crystal script which spins up both processes, etc
<FromGitter>
<r00ster91> ah me too. Unfornately IMO its currently pretty painful to create graphical apps with Crystal on Windows. Because you need to connect the windowing system of bash/linux to the windowing system of Windows 10. I used xming for that. It's very buggy and slow. I would for now use godot or wait for windows support for crystal
<FromGitter>
<Sija> @drum445 yep, although IMO Huxley was part of the “problem”, not a solution ;) that’s why he was so “foreseeing” in his book (btw, I’d recommend checking his bio - it tells a lot ;))
JuanMiguel has quit [Quit: This computer has gone to sleep]
<FromGitter>
<HarrisonB> @Sija
<FromGitter>
<Sija> good evening @HarrisonB, what’s up? :)
<sevensidedmarble>
hows everyone doing today?
<FromGitter>
<HarrisonB> Oops, sorry for the orpan message. @Sija strongly disagree with the NCoC. All of the trolling that has occurred so far have been intending to stir up this sentiment.
<FromGitter>
<Sija> @sevensidedmarble gr8! had been taking part in chestnuts picking competition along with black-colored squirrels, it was fun ;)
<FromGitter>
<Sija> how about you?
<sevensidedmarble>
Sija: pretty good, been trying to get some work done but also trying to work on my crystal shell
<z64>
hi all. wonder if someone can point me in the right direction - i have a PCM WAV file on disk that i need to pass as a buffer to a C function as `Int16*`. Using `File`, i can `IO#read(slice : Bytes)` (`Slice(UInt8)`) which I of course can't pass as `Int16*`.. what do I need to do to get this as the correct primitive in memory?
wontruefree has quit [Quit: bye]
<FromGitter>
<Sija> @HarrisonB call me lawless but I do believe that people don’t need any specific set of rules to discern “good” from “bad” or rather right from wrong
<sevensidedmarble>
I've been using this cool parsing library in crystal called CLTK but I haven't quite got it to parse function correctly
<FromGitter>
<HarrisonB> There was a recent sweep of trolling on the crystal issue board on GitHub intended to mock CoCs but I think people took the bait and believed the trolls were people actually trying to enforce CoC-like rules
<FromGitter>
<HarrisonB> @Sija the issue is that without a code in place there's nothing to point to when someone crosses that line
sevensidedmarble has quit [Client Quit]
sevensidedmarble has joined #crystal-lang
<FromGitter>
<Sija> @HarrisonB of course there is, ad-hominem attacks are well known technique and you don’t need any CoC to know and point to that
<FromGitter>
<HarrisonB> Haha, now I'm not *I* follow
<FromGitter>
<Sija> and that’s just one example, being polite, non-emotional and respectful towards others should be pretty obvious thing with no need to “encode it” into any formal document
<FromGitter>
<HarrisonB> totally agree with the *should*. but what do you do when that's violated?
<FromGitter>
<girng> what does `NCoC` stand for?
<FromGitter>
<Sija> I mean, it’s like saying that you should have some formal document in your family to regulate your own behaviour, because otherwise there’s nothing to point to
<FromGitter>
<r00ster91> No Code of Conduct
<FromGitter>
<HarrisonB> @girng @r00ster91 i think it is specifically referring to this document https://github.com/domgetter/NCoC (unless I'm mistaken)
<FromGitter>
<HarrisonB> @Sija the issue is that an Open Source proj isn't like a family, right? It's closer to work. And most places of employment have a handbook in which they outline harassment (in fact, in the US I think you *have* to have such a policy in place)
<FromGitter>
<Sija> well, I don’t agree
<FromGitter>
<elorest> Sure. But the standard is to include Coraline’s Coc, and it’s been demonstrated time and time again that resistance is futile. Sure most people in the community will respond well in most cases without it, and there will still be problems with it. ⏎ ⏎ Essentially it comes down to arguing that since people will follow the code anyway we don’t need it. At which point why not have it?
<FromGitter>
<Sija> it should be like family more like some anonymous, oftenly perverted work relation
<FromGitter>
<Sija> work structures were modeled by some very weird and fucked up ppl for very weird and fucked up reasons
<FromGitter>
<Sija> think: factories
<FromGitter>
<Sija> ford factories in the beginning of 20th century, nazi-s which picked it up later on
<FromGitter>
<HarrisonB> Can't talk for much longer as I'm at work (i'm in the PDT timezone), but I'd be happy to chat about this later
<FromGitter>
<Sija> IMO totally wrong basics to build a healthy community on ;)
<FromGitter>
<Sija> @HarrisonB same here, PM me if you’d talk some more :)
<FromGitter>
<HarrisonB> Last thing I'll say is that most of the policies outlining harassment are completely divorced from any historical origin with factories
<FromGitter>
<HarrisonB> They were reforms to counter the often rampant harassment that took place in those environments
wontruefree has joined #crystal-lang
<FromGitter>
<Sija> factories, not directly, no. usually they’re connected to the concept of political correctness
<oprypin>
z64, can't think of anything better than slice.to_unsafe.as(Int16*)
<FromGitter>
<girng> @sevensidedmarble post code and error, devs can help =]
<z64>
oprypin: sure, i'll try, but i have a feeling that there's more to it..
sevensidedmarble has joined #crystal-lang
<oprypin>
worst that could happen is endianness
<sevensidedmarble>
girng: do you know if they frequent crystal-lang on irc or gitter?
<oprypin>
if you don't forget to divide the size by 2
wontruefree has quit [Quit: bye]
<FromGitter>
<girng> @sevensidedmarble yes they are here. just super busy i think. oprypin is here and can help with mostly anything too.
<sevensidedmarble>
yeah everyone here is way smarter then me lol
<sevensidedmarble>
I feel like there's a stigma about asking help writing parsers and programming languages, because people think if you're writing a parser surely you should know enough to figure it out yourself
<sevensidedmarble>
and I've read all the original instructional stuff over at RLTK in ruby too
<sevensidedmarble>
originally the code that was there worked fine for functions that were only one expression
<sevensidedmarble>
but would break when parsing a function with multiple expressions
sagax has quit [Quit: Konversation terminated!]
<sevensidedmarble>
so I tried to extend it to parse functions that are either one Expression, or an ExpressionList
<sevensidedmarble>
but I haven't had much luck. I've tried a ton of things and usually I'll either get index out of bounds errors when it seems like the grammar is defined wrong in some way, or I can't seem to get it to recognize that an expression list inside a function is actually an expression list
<sevensidedmarble>
even though it does parse an expression list on it's own alright
<FromGitter>
<girng> Hmmmm
<sevensidedmarble>
oh and if anyone wants to run it you can just clone my repo, run `shards install` and run `crystal build src/cryshlang.cr`
<sevensidedmarble>
the other main file `crysh.cr` is just for the temporary shell without the parser. I'm building out the parser seperately and ideally merging it in when it actually works.
<sevensidedmarble>
I guess I probably need one production for a function that takes an Expression and one that takes an ExpressionList
<sevensidedmarble>
but even that didn't seem to work for me (but I'm no expert) and the docs seemed to indicate that it could already take lists as is
<sevensidedmarble>
like an ExpressionList was just an Expression too
<sevensidedmarble>
it does inherit from Expression after all
wontruefree has joined #crystal-lang
<sevensidedmarble>
it seemd really weird to do it like that though
<sevensidedmarble>
and have a whole seperate AST node for `FunctionWithExpression` and `FunctionWithExpressionList`
<sevensidedmarble>
I know it should be possible to do it with only one AST node, and just cast Expressions into ExpressionLists or something...
<sevensidedmarble>
I just can't quite get that working
DTZUZO_ has joined #crystal-lang
<FromGitter>
<j8r> I don't agree with the No Code Of Conduct. First line, "we are all adult". Nope, there are talented and mature children. This should be :"everyone should be mature"
<FromGitter>
<girng> @vladfaust nice work again hahah. looks good!!
<Vexatos>
only one of those has a username that is not just based on their real name
<FromGitter>
<vladfaust> Thanks! I appreciate that 😌
<FromGitter>
<Sija> @vladfaust nice and clean UI, good job! :)
<FromGitter>
<girng> megatux? :D
<Vexatos>
nah vladfaust of course
<FromGitter>
<vladfaust> @Sija why don't you publish yourself? :)
<FromGitter>
<vladfaust> @Vexatos I don't understand
<Vexatos>
much sarcasm
<Vexatos>
don't mind me
<Vexatos>
The UI is looking super nice ,_,
<FromGitter>
<girng> yah nice
<Vexatos>
I'm all for minimalism :I
<FromGitter>
<vladfaust> Me too!
<FromGitter>
<girng> me three!
<FromGitter>
<vladfaust> I'm glad you like it, men
<Vexatos>
also why I like the crystal logo >_<
<FromGitter>
<Sija> @vladfaust will do :)
<FromGitter>
<vladfaust> It really means a lot when someone appreciating your work
wontruefree has quit [Quit: bye]
<FromGitter>
<vladfaust> Gonna take the first meal in 8 hours :D
<Vexatos>
reminds me that I haven't eaten in 21 or so
<FromGitter>
<j8r> Days?
<Vexatos>
I wonder.
<FromGitter>
<girng> rofl
<FromGitter>
<vladfaust> *when you're a Crystaller :)
<FromGitter>
<vladfaust> No hirers = no meal
<Vexatos>
*when you're a crystal :)
<FromGitter>
<girng> not eating in 21 days.. not sure if possible to type on internet with wrists anymore :D
<FromGitter>
<girng> might be dead
<Vexatos>
as long as you take your vitamin supplements
<FromGitter>
<girng> 😆
<FromGitter>
<j8r> @vladfaust there can be a option to hire people for nothing. Example: a beginner search a project to work, another people search someone to work on
<FromGitter>
<markrjr> @straight-shoota @RX14 I posted a bit up about how to cross compile parts of the standard library for Windows, any insights on this?
<FromGitter>
<vladfaust> @j8r of course. Gonna add an ability to post job postings both for e-mail-registered companies and github devs
Heaven31415 has quit [Quit: Leaving]
<FromGitter>
<Sija> @Vexatos snow vitamins? :P
<FromGitter>
<j8r> Niiice.:D
<FromGitter>
<girng> crystal infused vitamins with shards
<FromGitter>
<j8r> Hum yeah not available, need to finish the migration to Hugo 🙄
<FromGitter>
<j8r> I was using Ghost, but don't want to have a dynamic blog in NodeJS anymore on my ARM board
<FromGitter>
<vladfaust> There are blog platforms on *Crystal* afaik
<FromGitter>
<j8r> A static one? Not really
<FromGitter>
<vladfaust> An idea for a project
<FromGitter>
<j8r> 💯
<FromGitter>
<j8r> Hugo is good by the way :)
<FromGitter>
<vladfaust> I believe you. However I'm not about Go
<FromGitter>
<sam0x17> if I am linking with an external C library, and there is a struct I need to define in crystal for use with one of the functions in the library, and one of the fields is a pointer to an instance of another (super complicated) struct in said library, can I use a void pointer (will that have the same memory layout?) and if so, how do I do that?
<FromGitter>
<j8r> Do you now you can generated bindings automatically? @sam0x17
<FromGitter>
<kingsleyh> I guess Crystal doesn't know what to do with that String time format - it's a fairly standard iso format though - so I'm surprised the Time library doesn't understand it
<FromGitter>
<sam0x17> that's also standard for rails
<FromGitter>
<kingsleyh> looks like Time.parse only works with this kind of string
<FromGitter>
<kingsleyh> ah I figured it out - it's a big long winded but it works
<FromGitter>
<kingsleyh> ```code paste, see link```
<FromGitter>
<codenoid> @vladfaust stuck in loading after "sign in" with github
<FromGitter>
<codenoid> btw, is crystal have pug-like template engine ?
<FromGitter>
<vladfaust> @codenoid got no erorr in logs, can sign in myself. Try again?
<FromGitter>
<drum445> @Sija indeed, but he was closer then Orwell with his predictions of our current dystopia
<FromGitter>
<codenoid> ok
<FromGitter>
<codenoid> i got new error
<FromGitter>
<Sija> @drum445 fair ‘nuff, I’d say that our current day dystopia combines these two, kind of stick and carrot approach - if you can’t buy ‘em, scare ‘em
<FromGitter>
<Sija> and ofc all of that in the sauce of hegelian dialectics - fascism vs communism = captialism being one of the most obvious ones from 20th century. all three are controlled so whole game is rigged from the beginning, but such mechanism are giving some sort of feeling of “freedom” to choose, so many fall for it I guess
tomte has quit [Ping timeout: 252 seconds]
<FromGitter>
<vladfaust> @codenoid any additional info?