<dom96>
@sherjilozair Nim's concurrency model is different to Crystal's: async await (Nim) vs. goroutine-like (Crystal). Nim is also further along when it comes to Windows support and parallelism (both have been supported in Nim for years now). Nim compiles to C/C++/ObjC or JS, Crystal compiles to LLVM.
<FromGitter>
<CaDs> @asterite I kind of agree that maybe a language rewrite would be a good thing to do. Especially now that you guys know what things you did get wrong and what things you did get right. β β We, users of the language, we don't really have much insight about what is going on internally, but although many of us are really looking forward to having a 1.0 version of the language, I don't really see people rushing
<FromGitter>
... the core dev team. On the contrary, you have a really nice community that is eager to help the language . You guys might as well start using it ;)
<FromGitter>
<drosehn> aside: note that there's a lot that I like about crystal, so I don't want to sound negative about it either. I don't work on crystal (or any other compiler!), but I do contribute to the BountySource campaign for it.
<FromGitter>
<bew> @asterite I agree with that, compiler too complex, and it's very hard to add or change anything.. To start the process of an (incremental?) rewrite, maybe we can start by defining the language, precisely what the language can do, what we want it to do, and for example write a language grammar, etc
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
<hightower2>
just realized that require "./path/to/*/file.cr" doesn't work
DTZUZO has quit [Quit: WeeChat 2.0]
DTZUZO has joined #crystal-lang
moei has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 264 seconds]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
<Majost>
I am new to Crystal and am trying to create a class for loading a YAML config file, and I am running into an issue when I try to build it as it "Can't infer the type of instance variable '@config' of Timberclaw::Config" `@config = load_config`
<Majost>
I am not sure what data type to assign it though since YAML is dynamic
<Majost>
The docs say it is `Any` -- but setting the type to `Any` does not seem to work
<Majost>
`YAML::Any` is probably the correct type -- but thats not quite working for me
<FromGitter>
<bew> Your yaml has some sort of structure, no?
<FromGitter>
<bew> Are you really expecting absolutely anything as a config file?
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
Yxhuvud has quit [Client Quit]
Yxhuvud has joined #crystal-lang
<FromGitter>
<Blacksmoke16> is there a concept of .send? or some way to call a method of an object dynamically by name?
<FromGitter>
<bew> No @Blacksmoke16
<FromGitter>
<Blacksmoke16> π
<FromGitter>
<bew> Do it manually if you really need it (with a case...end node)
<FromGitter>
<Blacksmoke16> rgr, just brainstorming atm
<Majost>
bew: fair, right now I am still prototyping the config structure though so I don't really want to do a `YAML.mapping` just yet.
<Majost>
I think I sorta got it -- but I am getting a Nil back from the YAML.parse... so something else is not right
<FromGitter>
<bararchy> I think he means regarding @asterite comments about Crystal .
<FromGitter>
<bararchy> Though we all know its useless to say "X needs a rewrite"
<FromGitter>
<bararchy> Because if it was something that would made sense, he could have forked the repo and do what he thought , and come back to us with a better compiler
<FromGitter>
<bararchy> But such a huge step takes a loooot of time and efforts and makes totally no sense in the state Crystal is in right now
<FromGitter>
<bararchy> Only to gain some ambiguous possibilities or avoid some ambiguous bugs
<FromGitter>
<sherjilozair> How do I create a global variable?
<crystal-gh>
[crystal] sdogruyol closed pull request #5998: Adds ability to use custom separators in CSV.build (master...fix-5987) https://git.io/vpZeZ
<FromGitter>
<sherjilozair> rather, how do I reference a global variable?
<FromGitter>
<oprypin> @sherjilozair need to make a class
<FromGitter>
<oprypin> could be a singleton or just a class that has a class variable
<FromGitter>
<bararchy> There is also `$var`
<FromGitter>
<bararchy> But you should try and refrain from using it
<FromGitter>
<sherjilozair> Is there a macro like `property` for class variables?
<FromGitter>
<bararchy> class property
<FromGitter>
<oprypin> @bararchy there is no $var actually
<FromGitter>
<bararchy> Really???
<FromGitter>
<bararchy> I thought its the naming for global variable
<FromGitter>
<bararchy> Maybe I'm too Ruby minded
<FromGitter>
<sherjilozair> `class_property` worked. Thanks @bararchy and @oprypin.
<FromGitter>
<sherjilozair> Btw, @oprypin, I'm using CrSFML to port the pico8 version of Celeste to Crystal. Mainly to learn Crystal, but I will later use it to extract out a higher-level API for gamedev in Crystal.
<FromGitter>
<ezrast> Using `obj.@ivar` is evil right? I can't think of a reason to ever want that outside of debugging.
<FromGitter>
<evandrojr> Hi guys! I get this error when I try to run crystal spec: β awesome_print git:(master) β crystal spec β /usr/bin/ld: cannot find -lxml2 β collect2: error: ld returned 1 exit status β Error: execution of command failed with code: 1: `cc "${@}" -o '/home/j/.cache/crystal/crystal-run-spec.tmp' -rdynamic -lxml2 -lpcre -lm -lgc -lpthread /usr/share/crystal/src/ext/libcrystal.a -levent -lrt -ldl
<FromGitter>
<evandrojr> Suppose I install crystal using apt, isn't is supposed to be crystal package dependencies?
<FromGitter>
<bararchy> well, it's only needed if you use XML parsing anywhere
<FromGitter>
<bararchy> as in `require html` or `require xml`
<FromGitter>
<bararchy> etc..
<FromGitter>
<evandrojr> the command spec needs it
<FromGitter>
<bararchy> spec for the compiler?
<FromGitter>
<bararchy> or just spec
<FromGitter>
<evandrojr> crystal spec
<FromGitter>
<evandrojr> is the command I used
<FromGitter>
<evandrojr> I am trying TDD for my lib
<FromGitter>
<bararchy> I see, I guess it might need it for some parsing? anyway, if it's indeed needed by the core binary then yes, it should have been included in the installation deb as depencendcy
<FromGitter>
<bararchy> @evandrojr you can open an issue in the github repo if you care about it :)
<FromGitter>
<evandrojr> @bararchy you are welcome, hope we can make crystal a great tool. For you and for me and the entire human race, (maybe aliens as well LOL )
<FromGitter>
<bararchy> hahah :)
<FromGitter>
<sdogruyol> morning everyone
cyberarm has quit [Ping timeout: 256 seconds]
<FromGitter>
<sdogruyol> thanks and welcome @evandrojr π
<FromGitter>
<evandrojr> π π @sdogruyol
<FromGitter>
<ajinkyapisal> Hello. I can't access crystal website due to connection not secure. Is anyone else having the same issue?
<FromGitter>
<evandrojr> Not for me
<FromGitter>
<drum445> @ajinkyapisal It is fine for me
<FromGitter>
<evandrojr> It is fine for me too
<FromGitter>
<ajinkyapisal> Just tested on Chrome and it works fine but can't access it on Firefox
<FromGitter>
<drum445> It might be something to do with the recent trustico cert issue
<FromGitter>
<drum445> New versions of browsers are blocking GeoTrust I think
<FromGitter>
<drum445> What version is your Firefox & Chrome?
<FromGitter>
<drum445> Although saying that, I am on latest Chromium and it loads fine (thinking)
<FromGitter>
<ajinkyapisal> Google Chrone Version 66.0.3359.117 (Official Build) (64-bit) β Firefox Quantam Version 59.0.2 (64-bit)
<FromGitter>
<bararchy> FireFox nightly on Arch Linux is working for me
<FromGitter>
<ajinkyapisal> oh no.. don't look at it. it was done as a school project and its just there (don't know why and not in working condition) π
<FromGitter>
<bararchy> github loves to show us our bad code memories
<FromGitter>
<bararchy> jajaj
<FromGitter>
<ajinkyapisal> forgot to mention that this error does not even allow to view website (and proceed via confirming exception)
<FromGitter>
<sherjilozair> okay, I'm dumb. I was inheriting from Object instead of GameObject.
<FromGitter>
<yxhuvud> @straight-shoota What you are saying is that the default implementation does that. plenty of classes override that behaviour, no? (otherwise we would end up in the crappy situation in java where string comparison would have to use "equals" etc)
<FromGitter>
<straight-shoota> true, that's the default implementation of `Reference#==`
<FromGitter>
<straight-shoota> There is also `Reference#same?` which should always compare object id's and not be overwritten by subclasses
<FromGitter>
<sherjilozair> Does the compiler not compile dead code? If I compile my code, can I be assured that I won't have typing errors, etc.?
<FromGitter>
<straight-shoota> AFAIK the compiler parses and compiles every code it sees (after expanding all macros). Then LLVM optimizes everything and probably removes most dead code. At least what's easy to discover.
<FromGitter>
<straight-shoota> So, yes errors in dead code will obviously be discovered.
<FromGitter>
<straight-shoota> But you can really disable code using macros. For example, `pending` in specs just lets the code in the block vanish, it will not be included in the final AST.
<FromGitter>
<Sija> @sherjilozair you better use Float64, with `.to_f/.to_f64`
<FromGitter>
<sherjilozair> Yeah, I did use `.to_f`. Less chars to type.
jwaldrip has quit []
<FromGitter>
<Sija> and better precision :)
jwaldrip has joined #crystal-lang
<FromGitter>
<sherjilozair> So there is a difference between `@var` and `self.var` when used in a method. The latter only works if the variable has been defined as a `property`.
<FromGitter>
<sherjilozair> A bit counterintuitive. I expected `@var` to be nothing but syntax sugar for `self.var`. I don't think I understand this model.
<FromGitter>
<sherjilozair> So, `@var` is the actual instance variable, and `self.var`and `self.var=` are methods?
<FromGitter>
<straight-shoota> @bararchy depends on what you mean with dead code
<FromGitter>
<Sija> @sherjilozair yep, same as in Ruby
<FromGitter>
<sherjilozair> I have 0 experience with Ruby. Coming from Python. Hence the many surprises. But I'm liking it so far.
<FromGitter>
<straight-shoota> access to instance variables is always private, you define methods to make them accessible from outside the class (though they are useful internally as well)
<FromGitter>
<sherjilozair> @straight-shoota But what about a function which was never called?
<FromGitter>
<straight-shoota> yes, a method is obviously only instantiated when it is called somewhere
<FromGitter>
<sherjilozair> So code inside the method/function won't be type-checked?
<FromGitter>
<straight-shoota> yes
<FromGitter>
<straight-shoota> the type checker can only check code that's reachable
<FromGitter>
<sherjilozair> this is very useful to know. thanks!
Majost has quit []
Majost has joined #crystal-lang
duane has quit [Ping timeout: 255 seconds]
ghostofme has quit [Quit: Leaving]
duane_ has joined #crystal-lang
woodruffw has quit [*.net *.split]
ssvb has quit [*.net *.split]
andrewzah has quit [*.net *.split]
Cyrus has quit [*.net *.split]
Cyrus has joined #crystal-lang
andrewzah has joined #crystal-lang
ssvb has joined #crystal-lang
woodruffw has joined #crystal-lang
cyberarm has quit [Ping timeout: 260 seconds]
cyberarm has joined #crystal-lang
<FromGitter>
<schoening> That can be good and bad. I had to out-comment two entire files just now coz TypeScript checks all files even those not imported into the project as long as they are in the folder :p
Ephatt has joined #crystal-lang
Ephatt has quit [Ping timeout: 248 seconds]
<FromGitter>
<girng> @bararchy ty for explanation. i understand what he meant now
guilleiguaran has joined #crystal-lang
Ephatt has joined #crystal-lang
<FromGitter>
<Whaxion> Hello, is it possible to get the type of an instance var before it exists (defined by @var : type) ?
<FromGitter>
<Whaxion> No, it's okay, I've found
Ephatt has quit [Ping timeout: 255 seconds]
faustinoaq has joined #crystal-lang
<FromGitter>
<sdogruyol> @RX14 when is your next stream
<FromGitter>
<fridgerator> lol I was just reading that
<FromGitter>
<bararchy> I have no idea who that is, with such an intimate understanding of Crystal goals and community events :)
<FromGitter>
<bararchy> but the points are valid
<FromGitter>
<bararchy> a cleanup and do great things
<FromGitter>
<bararchy> I remmber a week of crazy cleanup @asterite and @sdogruyol did closing around 100 issues, then RX14 and @sdogruyol again did a huge sweep
<FromGitter>
<bararchy> maybe we are due for another
shalmezad has joined #crystal-lang
woodruffw has quit [*.net *.split]
ssvb has quit [*.net *.split]
andrewzah has quit [*.net *.split]
Cyrus has quit [*.net *.split]
braidn[m] has quit [*.net *.split]
Renich has quit [*.net *.split]
cyberarm has quit [*.net *.split]
alex`` has quit [*.net *.split]
DTZUZO has quit [*.net *.split]
Groogy has quit [*.net *.split]
Nathanaelle has quit [*.net *.split]
thews has quit [*.net *.split]
Liothen has quit [*.net *.split]
omninonsense has quit [*.net *.split]
shelvacu has joined #crystal-lang
omninonsense has joined #crystal-lang
Liothen has joined #crystal-lang
thews has joined #crystal-lang
Nathanaelle has joined #crystal-lang
thews has quit [Excess Flood]
Renich has joined #crystal-lang
braidn[m] has joined #crystal-lang
ssvb has joined #crystal-lang
woodruffw has joined #crystal-lang
andrewzah has joined #crystal-lang
Cyrus has joined #crystal-lang
Renich has quit [Max SendQ exceeded]
DTZUZO has joined #crystal-lang
Groogy has joined #crystal-lang
alex`` has joined #crystal-lang
cyberarm has joined #crystal-lang
kp666[m] has quit [Ping timeout: 246 seconds]
fifr[m] has quit [Ping timeout: 256 seconds]
cptaffe has quit [Ping timeout: 256 seconds]
byteflame has quit [Ping timeout: 245 seconds]
thunker[m] has quit [Ping timeout: 246 seconds]
olbat[m] has quit [Ping timeout: 246 seconds]
kixune[m] has quit [Ping timeout: 268 seconds]
braidn[m] has quit [Ping timeout: 256 seconds]
betofloresbaca[m has quit [Ping timeout: 276 seconds]
moei has quit [Ping timeout: 240 seconds]
thews has joined #crystal-lang
thews has joined #crystal-lang
thews has quit [Changing host]
moei has joined #crystal-lang
<crystal-gh>
[crystal] Sija opened pull request #6008: Add missing tests for CSV.build with custom separator/quote_char (master...followup-to-5998) https://git.io/vpcBK
That_Guy_Anon has joined #crystal-lang
<crystal-gh>
[crystal] kostya opened pull request #6009: add json mapping extra fields (master...json_extra) https://git.io/vpcu6
ua_ has joined #crystal-lang
<crystal-gh>
[crystal] asterite closed pull request #3482: reference HTML parsing features elsewhere (master...html_parsing_doc) https://git.io/vXLO1
Nathanaelle has quit [Read error: Connection reset by peer]
faustinoaq has joined #crystal-lang
Nathanaelle has joined #crystal-lang
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
<FromGitter>
<faustinoaq> @bararchy Pretty nice Reddit post π
<FromGitter>
<girng> not me
<FromGitter>
<bararchy> Thanks @faustinoaq but TBH @sdogruyol found it and I just posted it here
<FromGitter>
<girng> good morning!!
<FromGitter>
<straight-shoota> hey
Nathanaelle has quit [Read error: Connection reset by peer]
Nathanaelle has joined #crystal-lang
faustinoaq has quit [Quit: IRC client terminated!]
<FromGitter>
<schoening> Just a random thought that popped into my head and I wanted some smart people answers :) β If an object has a string as a property. And that string gets sufficently large. Is the string re-allocated with a pointer to the object, or is the entire object resized?
fifr[m] has joined #crystal-lang
byteflame has joined #crystal-lang
Renich has joined #crystal-lang
braidn[m] has joined #crystal-lang
kp666[m] has joined #crystal-lang
betofloresbaca[m has joined #crystal-lang
cptaffe has joined #crystal-lang
thunker[m] has joined #crystal-lang
kixune[m] has joined #crystal-lang
<FromGitter>
<straight-shoota> An ivar of type String is always just a pointer
<FromGitter>
<straight-shoota> and embedded values (like primitives, tuples, structs etc.) have a fixed size, so there should never be a need to resize a container
<FromGitter>
<schoening> Wow, its nice to see I was not wrong for once :p thanks man. I read a blogpost about why object pooling can get really messy if the objects have dynamic bits inside them and it made me think of this.
duane__ has joined #crystal-lang
duane_ has quit [Ping timeout: 240 seconds]
<crystal-gh>
[crystal] asterite closed pull request #6007: Don't leak variable name when assining to ivar/cvar in method signature (master...feature/no-implicit-instance-var) https://git.io/vpc87
rohitpaulk has joined #crystal-lang
sagax has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 264 seconds]
<FromGitter>
<drum445> Not good when I've been using Crystal so much outside of work, I come to complete a bug in the office and keep typing Ruby syntax instead of Go...
<FromGitter>
<sdogruyol> @drum445 that's tough
<FromGitter>
<drum445> Saying that, the bug was someone using $gte instead of $lte in an ES query...
Ephatt has joined #crystal-lang
tilpner has quit [Remote host closed the connection]
Ephatt has left #crystal-lang [#crystal-lang]
Nathanaelle has quit [Read error: Connection reset by peer]