ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.30.1 | 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
<FromGitter> <rmarronnier> There is no complex logic in the regex but it was more convenient (and maintainable) using one expression per script than reimplementing a regex match with code (withunicode characters ranges etc.)
<FromGitter> <sam0x17> gotcha
<FromGitter> <sam0x17> also have you tried pasting the raw characters into the code and seeing what happens?
<FromGitter> <sam0x17> that is the first thing I would try even tho prob wont work
<FromGitter> <rmarronnier> hmm, so my IDE would translate those characters in their utf-8 values ?
<FromGitter> <sam0x17> maybe?
return0e has quit [Ping timeout: 245 seconds]
return0e has joined #crystal-lang
<FromGitter> <rmarronnier> Thanks for the ti, but I find it too hackish :-D I'll limit myself to UTF-8 for now but I'll keep my eyes open for a PCRE UTF-16 flag added to the Crystal Regex :-)
<FromGitter> <rmarronnier> *tip
_whitelogger has joined #crystal-lang
<FromGitter> <watzon> I was under the impression that hashes should be unique across objects, but it's looking like that's not the case
<FromGitter> <watzon> https://carc.in/#/r/7ftl
<FromGitter> <watzon> Does hash just generate a hash based on the object's contents then?
<FromGitter> <watzon> Or is it that clone is just not doing what I expect it to?
<FromGitter> <watzon> https://carc.in/#/r/7ftm
<FromGitter> <Blacksmoke16> https://carc.in/#/r/7fto maybe this?
<FromGitter> <sam0x17> has anyone tried defining the members of a type union via macro? tips tricks pitfalls?
<FromGitter> <Blacksmoke16> hm?
<FromGitter> <sam0x17> as in, I am going to try to have some macros that add members to a type union, so that the union will have only the needed members as determined at compile time based on what macros get called
<FromGitter> <Blacksmoke16> hmm
<FromGitter> <Blacksmoke16> still not sure i follow, but gl :P
<FromGitter> <watzon> Ahh yeah, that's what I'm looking for
<FromGitter> <Blacksmoke16> got an example? :P
<FromGitter> <sam0x17> so i.e. if this was for an ORM, it would be like a standard ORM setup with a huge type union, except the type type union will ONLY have the types that get mentioned in all the column definitions collectively
<FromGitter> <Blacksmoke16> in a hash?
<FromGitter> <sam0x17> so if there is no column that includes Int64, Int64 won't be in the union for that compilation
<FromGitter> <sam0x17> yeah, theoretically
<FromGitter> <Blacksmoke16> isnt that how it just works already?
<FromGitter> <Blacksmoke16> er nvm
<FromGitter> <sam0x17> and it would be per model
<FromGitter> <sam0x17> so the unions would be quite small
<FromGitter> <sam0x17> I really like this concept
<FromGitter> <Blacksmoke16> sec
<FromGitter> <Blacksmoke16> like this?
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d5f37512cdb146ad61f53bf]
<FromGitter> <Blacksmoke16> tada?
<FromGitter> <sam0x17> yup exactly that
<FromGitter> <Blacksmoke16> well then problem solved because i have that working
<FromGitter> <sam0x17> haha nice
<FromGitter> <Blacksmoke16> `fields = {} of String => Union({{@type.instance_vars.select { |ivar| ivar.annotation(Granite::Column) }.map(&.type).splat}})`
<FromGitter> <sam0x17> ty ty I would have done some dumb string manipulation to join on " | " probably xD
<FromGitter> <Blacksmoke16> np :P
<FromGitter> <sam0x17> but yeah this is for a non-orm purpose, the ORM analogy just fits perfectly
<FromGitter> <Blacksmoke16> really you just need to get an array of the possible types
<FromGitter> <Blacksmoke16> which is easy if they are ivars
<FromGitter> <Blacksmoke16> but other catch is it only works within context of a method
<FromGitter> <sam0x17> ah ok
<FromGitter> <sam0x17> I'll probably have to do constant re-opening then I'm guessing
<FromGitter> <Blacksmoke16> make a module that defines it when its included
<FromGitter> <sam0x17> yeah that's the plan, or are you saying I can avoid constants within a `macro included` block?
<FromGitter> <sam0x17> *avoid needing constants
<FromGitter> <Blacksmoke16> that was the idea, then just include that and it just works?
<FromGitter> <Blacksmoke16> i.e. the module defines `def to_h` that you can use to build the hash from the types ivars?
<FromGitter> <sam0x17> yes, thanks this helps a lot
<FromGitter> <Blacksmoke16> np
<FromGitter> <shinzlet> I have an issue with some YAML stuff I wanted to talk out with someone more experienced, but I'm not sure if this is the right place for questions. Is it okay if I ask here, or should I get out of your collective hair?
<FromGitter> <Blacksmoke16> sure whats up
<FromGitter> <watzon> @shinzlet this is the place, ask away
<FromGitter> <watzon> You can also ask in the forums at https://forum.crystal-lang.org, but here works just as well
<FromGitter> <shinzlet> I'm working on a little project right now where I need to work with a yaml data file. I need to have a way to create it if it doesn't exist, read from it if it does, and modify it. I figured the best way to do that would be making a `Config` class that includes YAML::Serializable, and giving all the properties default values. Then, if I wanted to create the nonexistent YAML file, I could just serialize a
<FromGitter> ... `Config.new` using the `to_yaml` method and write it to disk. It would also allow me to read the config with `from_yaml` and modify it as it if were an object (`Config.foo = "bar"`). When I actually do this, though, I run into a bunch of problems with trying to instantiate a `Config` using `Config.new`. The compiler tells me it ... [https://gitter.im/crystal-lang/crystal?at=5d5f4866c508da44c365f3b9]
<FromGitter> <watzon> I'll let @Blacksmoke16 handle this one, he is the master of serialization
<FromGitter> <shinzlet> Haha, sounds good. @Blacksmoke16, I have a minimal example of what I'm talking about if you'd like it.
<FromGitter> <Blacksmoke16> lol yea
<FromGitter> <Blacksmoke16> just add
<FromGitter> <Blacksmoke16> `def initialize; end`
<FromGitter> <Blacksmoke16> to your class
<FromGitter> <Blacksmoke16> :S
<FromGitter> <shinzlet> Ohhh, thank you! I had actually tried overwriting self.new, but it didn't go smoothly
<FromGitter> <Blacksmoke16> np
<FromGitter> <Blacksmoke16> however just know that you cant really edit the file as if it was an object
<FromGitter> <Blacksmoke16> you would ofc have to resave the obj to disk
<FromGitter> <Blacksmoke16> editing the obj isnt going to keep the yaml file in sync
<FromGitter> <shinzlet> Yup, yup - I just needed help with actually getting a modifiable object into memory
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <shinzlet> I'm Canadian, so it feels wrong to not get another thank you in - thank you
<FromGitter> <Blacksmoke16> eh
<FromGitter> <Blacksmoke16> 😉
<FromGitter> <Blacksmoke16> one idea is to define a method on the obj like `def save`
<FromGitter> <Blacksmoke16> which would do like
<FromGitter> <Blacksmoke16> ```File.write "path/to/file.yaml", self.to_yaml```
<FromGitter> <watzon> Like that
<FromGitter> <watzon> But simpler :)
<FromGitter> <shinzlet> Oh that's really cute! I'll keep it in mind :)
chemist69 has quit [Ping timeout: 252 seconds]
chemist69 has joined #crystal-lang
ht_ has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
ht_ has quit [Quit: ht_]
woodruffw has joined #crystal-lang
alex`` has quit [Ping timeout: 272 seconds]
alex`` has joined #crystal-lang
jhass has quit [Ping timeout: 258 seconds]
asterite has quit [Ping timeout: 276 seconds]
<FromGitter> <j8r> It could be more optimized using a IO though
<FromGitter> <j8r> with `File.open`
asterite has joined #crystal-lang
jhass has joined #crystal-lang
sz0 has joined #crystal-lang
<mps_> j8r: I pushed crystal 0.30.1 for both arches on alpine edge, if you didn't noticed yet
<FromGitter> <Blacksmoke16> anyone try out github actions yet?
duane has joined #crystal-lang
<FromGitter> <j8r> @Blacksmoke16 but this isn't the problem
<FromGitter> <j8r> `self.to_yaml` will be a `String`, not an `IO`
<FromGitter> <j8r> using `self.to_yaml io` will remove an intermediate array
<FromGitter> <Blacksmoke16> ah whats what you meant
<FromGitter> <j8r> mps_ didn't look at it yet, thanks
<FromGitter> <j8r> on my side I have the maximum with my limited knowledge of LLVM to provide information in the issue.
asterite has quit [Ping timeout: 264 seconds]
<FromGitter> <j8r> We are in a deadlock now :/
jhass has quit [Ping timeout: 272 seconds]
<mps_> it works with llvm5 on both arches and with llvm8 on x86_64 but not on aarch64
<mps_> that could be starting point for core crystal developers
<FromGitter> <j8r> we know that yes
<mps_> I don't know crystal internals so can't help
<FromGitter> <j8r> Of course, no problem :)
<FromGitter> <j8r> I don't know LLVM so I've done what they asked to do
<mps_> one note, with same llvm8 I've built rust 1.36 and it worked for some big programs without (known to me) issues
<FromGitter> <asterite> yes, because rust will represent i128 as an array, not as a i128... maybe because of that bug, not sure
<FromGitter> <asterite> Next version, 0.31.0, you will be able to compile it will LLVM 8
<mps_> asterite: nice to know that
asterite has joined #crystal-lang
jhass has joined #crystal-lang
<FromGitter> <dscottboggs_gitlab> do you think this a bug or am I just doing it wrong? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d6003cb9b381b084fdfcf4d]
<FromGitter> <dscottboggs_gitlab> This won't compile, it says T is an undefined constant
<FromGitter> <Blacksmoke16> prob need to do `Child(T)`
<FromGitter> <Blacksmoke16> when defining the struct
<FromGitter> <asterite> `T` is not visible inside inner types
<FromGitter> <dscottboggs_gitlab> This works ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d60045de403470ab6c351ec]
<FromGitter> <dscottboggs_gitlab> > T is not visible inside inner types ⏎ ⏎ Any particular reason?
<FromGitter> <asterite> Types are independent of scope
<FromGitter> <asterite> I guess the reason is: it works like that because it works like that
<FromGitter> <dscottboggs_gitlab> haha okay then
<FromGitter> <Blacksmoke16> https://github.com/crystal-lang/crystal/pull/8112 neat
<FromGitter> <nsuchy> @Blacksmoke16 would this in theory make Amber websites faster
<FromGitter> <nsuchy> since different threads could handle different connections and requests
<FromGitter> <Blacksmoke16> i think amber already does that internally, by forking the process. However i dont know much about any of it so :shrug:
<FromGitter> <Blacksmoke16> afaik that would be like a single process using multiple threads, while forking would be running multiple instances of the same process
<FromGitter> <nsuchy> Sounds like it would make crystal code cleaner
<FromGitter> <nsuchy> rather than relying on a bunch of sub processes or whatever
<FromGitter> <Blacksmoke16> guess we'll have to wait for the dev blog :)
<FromGitter> <nsuchy> :D
<FromGitter> <dscottboggs_gitlab> That's exciting! :D
DeBot has joined #crystal-lang
<FromGitter> <dscottboggs_gitlab> Is there any way to represent this type? `alias NestedArray = Array(Int32) | NestedArray(Array(Int32))`
sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter> <Blacksmoke16> `Array(Array(Int32))`?
<FromGitter> <dscottboggs_gitlab> No it's an `Array(Int32)` or an `Array(Array(Int32))` or `Array(Array(Array(Int32)))` ad infinitum
<FromGitter> <Blacksmoke16> `alias NestedArray = Array(Int32) | Array(NestedArray)`
<FromGitter> <Blacksmoke16> but *recursive alias*
<FromGitter> <dscottboggs_gitlab> yup doesn't work, but i could swear it did before
<FromGitter> <asterite> when you say it doesn't work, how it doesn't work?
flaviodesousa has joined #crystal-lang
flaviodesousa has quit [Client Quit]
<FromGitter> <nsuchy> Have you ever `Array(Array(Array(Array(Array(Array(Array(Array(Array(Array(Array(Array(Array(Array(Int64)))))))))))))))`
<FromGitter> <dscottboggs_gitlab> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d60205568406739f96e66ed]
<FromGitter> <tenebrousedge> https://play.crystal-lang.org/#/r/7fxn
<FromGitter> <dscottboggs_gitlab> oh
<FromGitter> <dscottboggs_gitlab> thanks
<FromGitter> <tenebrousedge> np
<FromGitter> <Blacksmoke16> isnt that what i said like 30min ago? :p
<FromGitter> <tenebrousedge> yes
<FromGitter> <dscottboggs_gitlab> yeah I tried `Array(Int32) | NestedArray` in response to that @Blacksmoke16 and that obviously still didn't work. sorry for misunderstanding you
<FromGitter> <Blacksmoke16> <3 np
<FromGitter> <ikaru5> Hello guys, can someone please help me with macros? Im looking for a way to share information between the macro definitions... ? Any chance? Somethink like instance variables for macros?
<FromGitter> <Blacksmoke16> yea
<FromGitter> <Blacksmoke16> well
<FromGitter> <Blacksmoke16> you mean like
<FromGitter> <dscottboggs_gitlab> there are macro variables and all constants are available in macro land
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d60237435f914538d7326c5]
<FromGitter> <Blacksmoke16> or like
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d602398e403470ab6c42d79]
<FromGitter> <watzon> Lol I've got someone telling me that Crystal is already multithreaded because fibers
<FromGitter> <tenebrousedge> be gentle :/
<FromGitter> <watzon> And that the MT PR is just adding unnecessary bloat to the language
<FromGitter> <dscottboggs_gitlab> oooof
<FromGitter> <Blacksmoke16> hehe
<FromGitter> <wontruefree> well it is either someone who doesnt know because no one has taught them or someone has told them and they just think they know better .....
<FromGitter> <watzon> They're 17 and think they know everything just because they've touched Crystal in the past
<FromGitter> <wontruefree> oh they are 17
<FromGitter> <rmarronnier> @tenebrousedge
<FromGitter> <wontruefree> this is a good resource https://crystal-lang.org/reference/guides/concurrency.html
<FromGitter> <watzon> Already showed him haha
<FromGitter> <wontruefree> well then :(
<FromGitter> <watzon> He's been destroyed by several people and is keeping it up. Typical teenager.
ht_ has joined #crystal-lang
<FromGitter> <wontruefree> I guess you should ask him to write you a proof
<FromGitter> <wontruefree> see what he comes up with
<FromGitter> <watzon> Lol I just might
<FromGitter> <watzon> Oh God, now he's using Process.fork as an argument
<FromGitter> <Blacksmoke16> thats the best you could do up till that PR
<FromGitter> <Blacksmoke16> would there be a benefit of forking if each process is also multithreaded? or im assuming one process with MT is enough to not jam the CPU?
<FromGitter> <watzon> > That's what I said, yet, if you run an amount of processes equivalent to the amount of CPU threads, and schedule yourself, you can archive better performance than using your fancy ass threading libraries
<FromGitter> <watzon> Omg tell me I'm having a nightmare lol
<FromGitter> <j8r> @dscottboggs_gitlab you better avoid recursive aliases
<FromGitter> <dscottboggs_gitlab> because they're going away? yeah... Don't know how else I would represent that though.
<FromGitter> <j8r> a struct, like `JSON::Any`
<FromGitter> <j8r> that's annoying to have no stack trace when linking statically :(
<FromGitter> <wontruefree> I am reading through https://github.com/crystal-lang/crystal/issues/8111 and was thinking why are fixpoint numbers not common in languages?
<FromGitter> <wontruefree> When you are not worried about memory footprint but want accuracy over space
<FromGitter> <wontruefree> it seems like a fixpoint number would be preferred
<FromGitter> <tenebrousedge> my understanding is that computers can't represent many numbers exactly
<FromGitter> <wontruefree> I dont think I know what you mean
<FromGitter> <tenebrousedge> Why Do Computers Suck At Math? (https://blog.codinghorror.com/why-do-computers-suck-at-math/)
<FromGitter> <tenebrousedge> Wikipedia has a short explanation of why fixed-point isn't common (https://en.wikipedia.org/wiki/Fixed-point_arithmetic#Computer_language_implementations)
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
<FromGitter> <wontruefree> Thanks I am reading these
<FromGitter> <wontruefree> hopefully this will make it all make more sense
<FromGitter> <bew> @j8r really? No trace when static linking? You know why?
<FromGitter> <galvertez> did the `finished` macro change recently? I used to be able to use it and enforce some behavior at the end of class inheritance
<FromGitter> <galvertez> but it's not working in 0.30.0 - `@type` is always the parent now
<FromGitter> <Blacksmoke16> got some example code?
<FromGitter> <galvertez> no I figured out what I was doing wrong
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <galvertez> before I was defining the finished macro inside the inherited macro
<FromGitter> <galvertez> it works now 😁
<FromGitter> <Blacksmoke16> cool
<FromGitter> <j8r> @bew it's a bug, it's already known by core members. Don't know personally
alex`` has quit [Ping timeout: 248 seconds]
alex`` has joined #crystal-lang
<FromGitter> <ikaru5> @Blacksmoke16 @dscottboggs_gitlab Thanks for the quick response. Did not expect it that fast :'D ⏎ I'll try to break my problem down... ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5d603adb68406739f96f24b8]
<FromGitter> <Blacksmoke16> you cant share values between macros outside of constants or annotations
alex`` has quit [Ping timeout: 245 seconds]
glassofethanol has joined #crystal-lang
<glassofethanol> Good afternoon
<FromGitter> <ikaru5> so no way to achieve this? ⏎ Maybe Im taking the wrong approach... Are you familiar with the ruby gem trailblazer? ⏎ There are "Operations" which provides a "step" macro. ⏎ So you define your Oparation class with a lot of methods and in the top you use `step :method_name` to define the execution order. Im very used to it and trying to build something like that... :) [
<FromGitter> <Blacksmoke16> and you just want to execute methods in a specific order?
<FromGitter> <Blacksmoke16> like `before_update`, `update`, `post_update`?
<FromGitter> <ikaru5> more like ⏎ ⏎ ```step :check_condition_one ⏎ step :create_some_stuff ⏎ step :notify_people ⏎ step :clean_up``` ⏎ ⏎ its just for code structure :) ... [https://gitter.im/crystal-lang/crystal?at=5d603df649ac0519239c33dc]
<FromGitter> <Blacksmoke16> hmm
<FromGitter> <ikaru5> its not bad if its not possible. ;) Still huge thanks for answering me!
<FromGitter> <Blacksmoke16> i would have to know more
<FromGitter> <Blacksmoke16> like are these methods specific to a class or an instance of a class?
return0e has quit [Remote host closed the connection]
<FromGitter> <Blacksmoke16> if they are specific to a class you could easily have some class var array of some type
<FromGitter> <Blacksmoke16> with a macro called `step` that just adds that method to the array
<FromGitter> <Blacksmoke16> where the macro handles finding the right method, and pushes it to the array
glassofethanol has left #crystal-lang [#crystal-lang]
return0e has joined #crystal-lang
<FromGitter> <ikaru5> this is exactly the way i managed it to do :D with a classvar array. ⏎ and it would be enough if the methods would be class methods, but they should be instance methods. ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5d60431968406739f96f65ef]
return0e has quit [Remote host closed the connection]
return0e has joined #crystal-lang
<FromGitter> <Blacksmoke16> what executes these methods?
<FromGitter> <Blacksmoke16> something in `Operation`?
<FromGitter> <ikaru5> yes, i simply use a "run()" method
<FromGitter> <Blacksmoke16> could prob get fancy with annotations
<FromGitter> <Blacksmoke16> er
<FromGitter> <Blacksmoke16> what if you define like an `add` method on `Operation`
<FromGitter> <Blacksmoke16> set that as an ivar to empty array
<FromGitter> <Blacksmoke16> then have step do like
<FromGitter> <Blacksmoke16> ```macro step(name) ⏎ add {{name}} ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5d604802022dba538e4bc88d]
<FromGitter> <Blacksmoke16> not sure if that would work or not, as it would prob be in class scope
<FromGitter> <Blacksmoke16> yea nvm
<FromGitter> <Blacksmoke16> you said they return a Bool and dont have any args? i.e. just operating on ivars?
<FromGitter> <ikaru5> xD ⏎ its funny since this is what i got now ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d6048d568406739f96f8dd2]
alex`` has joined #crystal-lang
<FromGitter> <ikaru5> ivars or the caller would provide some vars... im not that far atm
<FromGitter> <Blacksmoke16> sec
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/7fzk
<FromGitter> <Blacksmoke16> what about something like that
<rkeene> http://rkeene.org/tmp/engineers-triangle.html I can't tell if my math is right
<FromGitter> <Blacksmoke16> first off its not a triangle
<FromGitter> <Blacksmoke16> disappointed
<FromGitter> <ikaru5> Wow! Thanks you! :O this should work! but i need to learn more about annotations first^^ im still very new to crystal
<rkeene> Blacksmoke16, It's conceptually a triangle, 3 lines -- just not visually :-D
<FromGitter> <Blacksmoke16> @ikaru5 does it matter the order each method is executed in?
<FromGitter> <Blacksmoke16> er, ill leave you to play with that, im quite knowledgeable on annotations/macros if you come across something else you need it to do
<FromGitter> <ikaru5> okay, thanks again. ^^ ⏎ i wondor why nobody did something like that already... trailblazer made a big impact in the ruby world. it seems like crystal got not enough attention in the past year :(
<FromGitter> <Blacksmoke16> iirc someone mentioned it before
<FromGitter> <Blacksmoke16> (might have been you tho, i dont remember who it was)
<FromGitter> <ikaru5> :'D possible
<FromGitter> <ikaru5> @Blacksmoke16 thanks to your example i finally got it working even without the annotations :]
<FromGitter> <Blacksmoke16> nice!
<FromGitter> <dscottboggs_gitlab> why doesn't this work?
<FromGitter> <dscottboggs_gitlab> https://play.crystal-lang.org/#/r/7g0s
<FromGitter> <Blacksmoke16> you're using ivars on the top level
<FromGitter> <Blacksmoke16> i.e. in the class scope
<FromGitter> <Blacksmoke16> vs in the scope of an object instance
<FromGitter> <dscottboggs_gitlab> yeah I get it now
<FromGitter> <Blacksmoke16> you could have your steps macro define the initializer and push the methods
<FromGitter> <dscottboggs_gitlab> https://play.crystal-lang.org/#/r/7g0w
<FromGitter> <dscottboggs_gitlab> yes but that would occupy the initializer and not allow for initalization in other manners
<FromGitter> <Blacksmoke16> like what?
<FromGitter> <dscottboggs_gitlab> or would break the system if the initializer were overloaded with a different arity
<FromGitter> <Blacksmoke16> true
<FromGitter> <dscottboggs_gitlab> https://play.crystal-lang.org/#/r/7g0z
<FromGitter> <Blacksmoke16> what about it?
ht_ has quit [Quit: ht_]
<FromGitter> <Blacksmoke16> just call `super`
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/7g11
<FromGitter> <Blacksmoke16> not really a big deal
<FromGitter> <dscottboggs_gitlab> hm
<FromGitter> <Blacksmoke16> i did notice a but where you cant call super if the parent doesnt have any args but the child does
<FromGitter> <Blacksmoke16> without doing like `*args` on the parent
<FromGitter> <dscottboggs_gitlab> I still don't get why the macro variable `methods` isnt' defined...
<FromGitter> <dscottboggs_gitlab> oh I can just expand and do it at runtime dug
<FromGitter> <Blacksmoke16> 👍
rohitpaulk has joined #crystal-lang
<FromGitter> <dscottboggs_gitlab> ok so Idk if this can even work but it really seems like there should be a way to get this to work in crystal. like this is one of the basic elements of a DSL. https://play.crystal-lang.org/#/r/7g1k
<FromGitter> <sam0x17> anyone know a good *current* source of crystal language stickers? all the stickermule links seem to be broken
mps_ has left #crystal-lang [#crystal-lang]
mps has joined #crystal-lang
<FromGitter> <watzon> So @dscottboggs_gitlab, you can try something like this. Maybe this will at least help you see what is going wrong.
<FromGitter> <watzon> @sam0x17 I don't, but if you find one please post it here. I'd like a few.
<FromGitter> <dscottboggs_gitlab> oh jeeze that's not what I was going for lol
<FromGitter> <dscottboggs_gitlab> but you can't set values on a `@instance` variable from in a macro........
<FromGitter> <watzon> Lol I have no clue what you were going for then 😂 just figured I'd try and make it compile
<FromGitter> <watzon> No unfortunately not, you either have to use a class var or a constant
<FromGitter> <dscottboggs_gitlab> I know that feel bro 😀
<FromGitter> <dscottboggs_gitlab> > No unfortunately not, you either have to use a class var or a constant
<FromGitter> <watzon> Oh btw, going way back to our conversation about NaCl and your libsodium library: if you want to merge what I have into your library I wouldn't be at all opposed. It would make sense to have one good library that completely implements libsodium instead of multiple.
<FromGitter> <watzon> I got busy and haven't been able to work on it
rohitpaulk has quit [Ping timeout: 258 seconds]
duane has quit [Ping timeout: 245 seconds]
<FromGitter> <dscottboggs_gitlab> shit, did I bind libsodium and totally forget?
<FromGitter> <watzon> Maybe it was someone else lol
<FromGitter> <watzon> I'll have to go look at my issues for NaCl 😂
<FromGitter> <watzon> Duh, it wasn't you 😂 I'm just stupid
<FromGitter> <watzon> Apparently I haven't been getting notifications on this lol
<FromGitter> <dscottboggs_gitlab> no it's ok I do a lot of bindings and I'm pretty forgetful so could've been me :P
<FromGitter> <dscottboggs_gitlab> > I haven't been getting notifications ⏎ that sucks
<FromGitter> <dscottboggs_gitlab> that penis-snake lol
<FromGitter> <watzon> 😂
<FromGitter> <watzon> And here @didactic-drunk thinks I've been ignoring him
<FromGitter> <dscottboggs_gitlab> right? WTF github!?
<FromGitter> <watzon> I get so many notifications maybe I just didn't see them and marked them as read on accident
<FromGitter> <watzon> I'm a member of a couple orgs that spam my notifications
<FromGitter> <sam0x17> @watzon on redbubble: https://www.redbubble.com/shop/crystal+language?ref=search_box
<FromGitter> <watzon> Hah! There we go 😁
<FromGitter> <watzon> Not a bad price either
<FromGitter> <watzon> I'll keep redbubble in mind for when I get my new laptop
<FromGitter> <dscottboggs_gitlab> I should definitely get one of those for on my server
<FromGitter> <watzon> I just need one for my life
<FromGitter> <watzon> Crystal == Life right now lol
<FromGitter> <dscottboggs_gitlab> come on guys
<FromGitter> <watzon> Lol, we're surprised?
<FromGitter> <dscottboggs_gitlab> I fuckin hate 2019 internet
<FromGitter> <watzon> In good news I found a search provider that's actually doing something good *and* protects your privacy
<FromGitter> <watzon> https://ecosia.org
<FromGitter> <dscottboggs_gitlab> sorry what?
<FromGitter> <dscottboggs_gitlab> 65 million trees? that's a lot
<FromGitter> <watzon> Yep! And the Amazon is going to need all the help it can get haha
<FromGitter> <watzon> I like their premise
<FromGitter> <dscottboggs_gitlab> for sure
<FromGitter> <watzon> 80% of their profits go to planting trees
<FromGitter> <watzon> And it's not a bad search engine
<FromGitter> <dscottboggs_gitlab> wish their url was a little more memorable....
<FromGitter> <watzon> I just remember the *eco* part because they're planting trees, then the rest comes to me haha
<FromGitter> <watzon> I just learned about them yesterday
<FromGitter> <dscottboggs_gitlab> chopping up a part of one of their artcles: ⏎ ⏎ > At Ecosia... we collect data and do statistical analysis to understand user behavior and trends, how people use our services, and to monitor, troubleshoot, and improve Ecosia. For this we use a self-hosted, secure and encrypted in-house analytics system. This allows us to gather data about how our users interact with Ecosia products in a secure
<FromGitter> ... and anonymized way. ⏎ ⏎ OMG what do I need to learn to get them to hire me fuck [https://gitter.im/crystal-lang/crystal?at=5d606a31a498b67237853795]
<FromGitter> <watzon> @dscottboggs_gitlab https://ecosia.workable.com/
<FromGitter> <watzon> They use Go and Python
<FromGitter> <watzon> Eww
<FromGitter> <dscottboggs_gitlab> oh shit I know go *and* python!
<FromGitter> <watzon> Good thing I like what they're doing, because I'm having a moral quandry
<FromGitter> <dscottboggs_gitlab> I don't particularly *like* writing either, but like... I realize crystal isn't that marketable and I'm not experienced enough at C++ or Rust for work.
<FromGitter> <watzon> Yeah Crystal needs to hit v1 already so companies won't be so afraid to use it. I am lucky to be using it at my job,
<FromGitter> <watzon> Speaking of Lucky, I want a Lucky Framework sticker too
<FromGitter> <Blacksmoke16> > but you can't set values on a `@instance` variable from in a macro........ ⏎ ⏎ right, why should you be able to?
<FromGitter> <Blacksmoke16> you can but you have to be within the scope of an object
<FromGitter> <Blacksmoke16> you obs cant do it just anywhere in the class body
<FromGitter> <dscottboggs_gitlab> > Yeah Crystal needs to hit v1 already ⏎ ⏎ I agree. I think they (we?) should focus on API stabilization after #8112 is merged, and drop the requirement for windows support for 1.0. With WSL2 there's no reason why a corporate windows shop would use crystal in WSL.
<FromGitter> <dscottboggs_gitlab> POSIX FTW
<FromGitter> <sam0x17> I'm gettin a haul xD
<FromGitter> <dscottboggs_gitlab> what's the third one?
<FromGitter> <sam0x17> alpine
<FromGitter> <sam0x17> linux
<FromGitter> <watzon> I need Crystal, Ruby, Arch, Rust, and Lucky Framework to start with
<FromGitter> <watzon> The only one missing is Lucky
<FromGitter> <sam0x17> lucky you'll probably end up having to order from a custom site and get like 50 of them minimum purchase size lol
<FromGitter> <dscottboggs_gitlab> at that rate just go buy some sticker paper and print it out yourselrf
<FromGitter> <watzon> I could probably just message Programming Swag on redbubble and get them to add it
<FromGitter> <Brandongoodman615> Hey Hey guys, Ruby noob trying to play around with Crystal. Did a Ruby bootcamp and less than a year experience. So apologizing ahead of time for the questions lol
<FromGitter> <watzon> Woah that's some serious blur
<FromGitter> <Blacksmoke16> o/
<FromGitter> <watzon> @Brandongoodman615 no problem, welcome to the community
<FromGitter> <Brandongoodman615> thanks!
<FromGitter> <Brandongoodman615> planning on trying to write some noob tutorials like i used in my Ruby bootcamp.
<FromGitter> <watzon> More learning resources are always good. I suggest using dev.to, as a lot of us do.
<FromGitter> <Brandongoodman615> I got my first app made and setup a github repo
<FromGitter> <watzon> Also if you have bigger questions that aren't a good fit for chat you can always ask on https://forum.crystal-lang.org
<FromGitter> <watzon> We all like to help each other out wherever though
<FromGitter> <watzon> It's a good community
<FromGitter> <Brandongoodman615> on mac mojave and struggling to get icr working, was linked here by Jeremy Woertink when submitting an issue to the github
<FromGitter> <watzon> What's failing? Does it seem to be an LLVM issue? I know macOS tends to have issues with LLVM.
<FromGitter> <Brandongoodman615> getting an -lssl error and I have open ssl installed and I tried reinstalling
<FromGitter> <Brandongoodman615> I got all the steps done and the build and install both fail
<FromGitter> <watzon> Ahh yeah, mac tends to have issues there too
<FromGitter> <dscottboggs_gitlab> TBH crystal isn't a very repl-friendly language, you're better off using the playground. But I've never gotten the playground working on macos either. Not that I've tried. I just noted that it didn't work and SSH'd into a linux box to ru it.
<FromGitter> <watzon> Yeah mac makes you work for things haha
<FromGitter> <watzon> The issue @Blacksmoke16 linked to should help though
<FromGitter> <Brandongoodman615> I think I tried that one from a search, let me try again
<FromGitter> <Brandongoodman615> mac has some trouble but try installing ruby on windows lol
<FromGitter> <dscottboggs_gitlab> @Brandongoodman615 do you have docker?
<FromGitter> <Brandongoodman615> not sure, so assuming no
<FromGitter> <watzon> Yeah on Windows you just need to use WSL
<FromGitter> <watzon> It solves most everything
<FromGitter> <watzon> Not good for anything graphical unfortunately
<FromGitter> <dscottboggs_gitlab> > try installing ruby on windows lol ⏎ ⏎ I haven't used windows in years, but I can imagine...
<FromGitter> <Brandongoodman615> `zsh: command not found: xport` when I try to run that first command
<FromGitter> <watzon> You're missing an `e`
<FromGitter> <watzon> `export`
<FromGitter> <Brandongoodman615> ok building again
<FromGitter> <Brandongoodman615> ```+/bin/zsh:23> icr ⏎ zsh: command not found: icr ⏎ brandons-mbp% `````` [https://gitter.im/crystal-lang/crystal?at=5d60720549ac0519239d988f]
<FromGitter> <Brandongoodman615> hmm that didnt work right
<FromGitter> <Brandongoodman615> triple ` not work?
<FromGitter> <watzon> In gitter? It does.
<FromGitter> <Brandongoodman615> ```+/bin/zsh:23> icr ⏎ zsh: command not found: icr ⏎ brandons-mbp% `````` [https://gitter.im/crystal-lang/crystal?at=5d60723935f914538d7563a0]
<FromGitter> <Blacksmoke16> The ticks have to be on their own line
<FromGitter> <watzon> Did you just run `make`? Or `make install` as well?
<FromGitter> <Brandongoodman615> just make
<FromGitter> <watzon> If you want it to be on the path you need to do `sudo make install`
<FromGitter> <watzon> It'll put it on your PATH
<FromGitter> <watzon> Either that, modify your PATH variable, or move `./bin/icr` to be on your PATH
<FromGitter> <Blacksmoke16> Or just use the playground and not bother
<FromGitter> <Brandongoodman615> `make` didn't throw an error that time but `sudo make install` did
<FromGitter> <Brandongoodman615> sounds good to me
<FromGitter> <Brandongoodman615> can you link the playground?
<FromGitter> <watzon> It may have thrown an error because `make install` is set up to work with linux
<FromGitter> <watzon> Idk
<FromGitter> <Blacksmoke16> do you have crystal installed?
<FromGitter> <Brandongoodman615> yep
<FromGitter> <Blacksmoke16> Just do `crystal play`
<FromGitter> <watzon> And then open http://localhost:3000 in your browser
<FromGitter> <Brandongoodman615> sweet
<FromGitter> <Brandongoodman615> thanks guys
<FromGitter> <watzon> If you want to share code samples you can also use https://carc.in
<FromGitter> <dscottboggs_gitlab> no it's `http://localhost:8080/` by default
<FromGitter> <watzon> Is it?
<FromGitter> <dscottboggs_gitlab> mmhmm
<FromGitter> <watzon> I haven't used it in a while haha
<FromGitter> <dscottboggs_gitlab> TBH that's what I use instead of a basic calculator now...
<FromGitter> <watzon> Lol
<FromGitter> <watzon> I mean if it works it works
<FromGitter> <Brandongoodman615> I just cmd click the link in terminal but yea its `http://127.0.0.1:8080`
<FromGitter> <dscottboggs_gitlab> I like to assign my numbers to variables
<FromGitter> <watzon> This is killing me right now
<FromGitter> <watzon> Fuck math
sorcus has quit [Ping timeout: 264 seconds]
<FromGitter> <dscottboggs_gitlab> I keep meaning to get around to learning ML and never getting to it
<FromGitter> <watzon> It's a pain in the ass
<FromGitter> <watzon> Really cool
<FromGitter> <watzon> But a serious pain
<FromGitter> <dscottboggs_gitlab> Oh yeah
<FromGitter> <dscottboggs_gitlab> but the point is to only be a pain in the ass once
<FromGitter> <watzon> True
<FromGitter> <dscottboggs_gitlab> then nobody else has to have that pain
<FromGitter> <watzon> This project has been super difficult. There's just something wrong with my math that's throwing everything off.
sorcus has joined #crystal-lang
<FromGitter> <watzon> I mean, at least I'm getting paid to work on it
<FromGitter> <watzon> But I'm gonna be bald before I finish
<FromGitter> <dscottboggs_gitlab> haha I don't think it'll be that long
<FromGitter> <dscottboggs_gitlab> althoug for mme it didnt't take long....
<FromGitter> <watzon> I mean from pulling out my hair 😂
<FromGitter> <dscottboggs_gitlab> oh haha
<FromGitter> <sam0x17> @dscottboggs_gitlab ICR is going to be frustrating because what it's doing under the hood is basically just re-run everything you have entered so far each time you hit enter
<FromGitter> <sam0x17> crystal doesn't have a real (or good fake) repel yet
<FromGitter> <dscottboggs_gitlab> yeah, I don't get how it would make any sense to have a crystal repl
<FromGitter> <sam0x17> the closest thing convenience wise is the `exec` feature in amber i.e. `amber exec 'User.where(name: "sam")'`
<FromGitter> <sam0x17> but that's specific to amber
<FromGitter> <sam0x17> rust has a crate that offers a more legit repl, because they did some stuff with the compiler that makes it easy to do whatever compiler trickery makes that happen , so theoretically it could happen with crystal someday
<FromGitter> <sam0x17> some googler did it
<FromGitter> <Blacksmoke16> @sam0x17 `crystal eval 'puts 2 * 2'`
<FromGitter> <sam0x17> oh yeah that too
<FromGitter> <sam0x17> i always forget about that