RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.27.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> <wontruefree> are there any benchmarks on the performance impact of macros?
<FromGitter> <Blacksmoke16> extended use would moreso have an impact on compile time
<FromGitter> <Blacksmoke16> as macros are just expanded into code in place at compile time
<FromGitter> <wontruefree> that seems like it would make sense I am just curious how much of an impact it would have
jemc has quit [Ping timeout: 255 seconds]
<FromGitter> <wontruefree> libraries coming out make heavy use of DSLs
<FromGitter> <wontruefree> I am curious what the impact would be if the projects grows
<FromGitter> <Blacksmoke16> id imagine, but to what degree would have to test it
<FromGitter> <wontruefree> looks like when compiling the amber CLI it take about 30% of the compilation time
<FromGitter> <wontruefree> that does use some macros but I dont know how much
<FromGitter> <Blacksmoke16> how did you tell?
<FromGitter> <Blacksmoke16> `--stats` when building or something?
<FromGitter> <wontruefree> yep
<FromGitter> <Blacksmoke16> do you know which section it takes place in?
<FromGitter> <Blacksmoke16> imagine one of the codegen blocks?
<FromGitter> <wontruefree> I dont know
<FromGitter> <Blacksmoke16> :P
<FromGitter> <Blacksmoke16> fair enough
<FromGitter> <wontruefree> looks like there are only 2 files it happens in
<FromGitter> <wontruefree> would it make sense to build a web app with one of these DSLs and compile it then expand the macros and compile it and see the difference?
<FromGitter> <wontruefree> I guess if the dependent libraries all use macros that would not be an accurate test
<FromGitter> <Blacksmoke16> hard to test iom
<FromGitter> <wontruefree> yeah I am not sure how to do it accurately
<FromGitter> <wontruefree> seems like it might have a big impact on compile time
<FromGitter> <wontruefree> more then I originally thought
<FromGitter> <girng> @Blacksmoke16 nope. i just wanted to use a global Array alias, but it's actually returning a tuple as well (https://github.com/crystal-lang/crystal-db/issues/97), not an array of values. so honestly, i'll just go back to using a `Tuple` alias and when i need to modify a certain tuple, i'll just create a new one with the way @z64 described earlier. i think i got confused with how arrays work, they don't really
<FromGitter> ... work like Tuples (from my experience)
<FromGitter> <Blacksmoke16> they dont
moei has quit [Ping timeout: 258 seconds]
moei has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter> <girng> if i change line 6 to `ItemTuple2.types`, it works. but why don't i need the "class" dot notation anymore?
<FromGitter> <girng> also, why is `ItemTuple.class.types` displaying `Class`? instead of the type? i'm so confused
<FromGitter> <Blacksmoke16> hm
<FromGitter> <girng> @Blacksmoke16 what do you think here? https://github.com/crystal-lang/crystal-db/issues/98
<FromGitter> <Blacksmoke16> tbh i never used the raw db shard much
<FromGitter> <Blacksmoke16> so im not super familiar with how it should work/how to improve it
<FromGitter> <girng> np, just thinking a lot about Tuples lately. No idea why
<FromGitter> <Blacksmoke16> a day in the life of girng
jemc has joined #crystal-lang
<FromGitter> <Blacksmoke16> wanna see something cool?
<FromGitter> <girng> yeah
<FromGitter> <Blacksmoke16> so still working on that tutorial/blog post
<FromGitter> <Blacksmoke16> but here is a sneak peek from it
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c70bcd600aa630d9af8a06e]
<FromGitter> <Blacksmoke16> i defined a callback in an abstract stuct that will execute before a route's action will execute
<FromGitter> <Blacksmoke16> this validates that a valid JWT token was in the request headers
<FromGitter> <Blacksmoke16> if so, looks up the user with the given id, and sets it as a class var
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c70bd105df86a45687cd962]
<FromGitter> <Blacksmoke16> i then have a controller that inherits from that abstract struct
<FromGitter> <girng> good lord
<FromGitter> <Blacksmoke16> since its a child of it, it has access to the `current_user` method that returns the current user obj from the JWT token, sets the owner of the article, and saves and returns it
<FromGitter> <Blacksmoke16> 💯
<FromGitter> <girng> and i thought i was learning crystal after a year... guess i'm doing something wrong lmao
<FromGitter> <Blacksmoke16> haha, its pretty slick i gotta admit
<FromGitter> <girng> i don't think my codebase has one instance of :: tbh lol
<FromGitter> <Blacksmoke16> everything just on top level?
<FromGitter> <girng> yeah, literally just 1 class and tons of methods
<FromGitter> <Blacksmoke16> welp
<FromGitter> <girng> LOL
<FromGitter> <Blacksmoke16> isnt that confusing/hard to manage?
<FromGitter> <Blacksmoke16> write any tests yet?
<FromGitter> <girng> well, a couple structs (like Vector2) and 1 class for db.mapping
<FromGitter> <Blacksmoke16> write any tests yet?
<FromGitter> <girng> hahah
<FromGitter> <girng> nope
<FromGitter> <Blacksmoke16> double welp
<FromGitter> <Blacksmoke16> you should really do that
<FromGitter> <girng> well, game will be in closed beta first that's my test lol
<FromGitter> <Blacksmoke16> like it'll help know that changes you make dont break anything
<FromGitter> <Blacksmoke16> and is pretty easy
<FromGitter> <Blacksmoke16> *do et*
<FromGitter> <girng> are you a pascal case kind of guy?
<FromGitter> <Blacksmoke16> the language?
<FromGitter> <Blacksmoke16> never used it
<FromGitter> <girng> or just abiding to by how crystal syntax is
<FromGitter> <Blacksmoke16> how do you mean?
<FromGitter> <girng> haha i mean PascalCase like that
<FromGitter> <girng> style of writing
<FromGitter> <Blacksmoke16> well kinda limited as class names have to be pascal case
<FromGitter> <Blacksmoke16> constants i do as screaming snake
<FromGitter> <Blacksmoke16> and enum members i do as pascal as well to differentiate them from constants
<FromGitter> <girng> do you like that style?
<FromGitter> <Blacksmoke16> i dont mind it
<FromGitter> <girng> hahah. same here
<FromGitter> <Blacksmoke16> But for real, you should write some tests
<FromGitter> <Blacksmoke16> Don't have to do them all at once, some as you go is a start
f1refly has quit [Ping timeout: 264 seconds]
<FromGitter> <girng> i plead my username
<FromGitter> <Blacksmoke16> *heavy sigh* :p
<FromGitter> <girng> 😆
<FromGitter> <girng> @Blacksmoke16 how did you start learning programming? from personal hobbies, university, or?
<FromGitter> <Blacksmoke16> Mostly self taught
<FromGitter> <girng> nice
<FromGitter> <girng> i have a computer information systems certificate from college, that's it. took no programming courses tho
<FromGitter> <girng> cause back then, i was working on my game with nodejs, they had no nodejs classes
<FromGitter> <Blacksmoke16> all started with that shitty website :P
<FromGitter> <Blacksmoke16> hosted on google drive
<FromGitter> <Blacksmoke16> that pulled the button values from a google sheet
<FromGitter> <Blacksmoke16> no that was later version, all hard coded manually :P
<FromGitter> <girng> ships of what?
<FromGitter> <Blacksmoke16> game i play
<FromGitter> <girng> part of eve online?
<FromGitter> <Blacksmoke16> yea
<FromGitter> <girng> ohhhh
<FromGitter> <Blacksmoke16> used to have an in game browser, so clicking those buttons would execute javascript to open an in game mail with to, subject and body pre filled
<FromGitter> <girng> what year was this just curious?
f1refly has joined #crystal-lang
<FromGitter> <Blacksmoke16> so people would order ships from me and id buy them, move them, and sell them to them for a markup for profit
<FromGitter> <Blacksmoke16> hm
<FromGitter> <girng> you talking about in-game profit or real life money profit?
<FromGitter> <Blacksmoke16> in game profit
<FromGitter> <Blacksmoke16> and imma say ~mid 2015
<FromGitter> <girng> i don't know how eve online works, but i heard real life money can be involved. like how diablo 3 had that real life money auction house. or maybe i'm thinking of a diff game
<FromGitter> <girng> so your eve online selling/etc "site" is the gateway that drove you into programming?
<FromGitter> <Blacksmoke16> mid 2014*
<FromGitter> <Blacksmoke16> pretty much
<FromGitter> <girng> that's pretty cool, LOL
<FromGitter> <Blacksmoke16> https://eve.tools/buddy-freight is what i got going now
<FromGitter> <Blacksmoke16> calc for courier service i ran for a while, moving goods from point a to b for a fee
<FromGitter> <Blacksmoke16> api that feeds that is using kemal :P
<FromGitter> <Blacksmoke16> doin that nice 18ms response time haha
<FromGitter> <girng> cool
<FromGitter> <girng> you must be heavily invested in that game eh, or at least find it fun huh lol
<FromGitter> <girng> i could never get into myself...
<FromGitter> <Blacksmoke16> been playing for 9 years now?
<FromGitter> <girng> more of aRPG player, diablo 2, path of exile, etc
<FromGitter> <girng> but i did try it
<FromGitter> <Blacksmoke16> is free to play now
<FromGitter> <girng> LOL
<FromGitter> <Blacksmoke16> with limitations ofc
<FromGitter> <girng> i might give it a shot l8er
<FromGitter> <Blacksmoke16> it has really nice third party dev support, so was more fun to me to work on projects to help me in game
<FromGitter> <Blacksmoke16> https://esi.evetech.net/ui/ got a nice read/write json api now
<FromGitter> <Blacksmoke16> so can like send mails or set your dest in game programmatically
<FromGitter> <Blacksmoke16> can do some pretty neat stuff
<FromGitter> <Blacksmoke16> people made tools that is like a map of a region on a web ui
<FromGitter> <Blacksmoke16> that parses chat logs to provide audio/visual warnings when hostiles get x jumps away from you
<FromGitter> <girng> that's pretty cool how you got involved in a game's API that eventually catapulted you to get into programming
<FromGitter> <girng> from a game.. that you played for years
<FromGitter> <Blacksmoke16> worked out quite well haha
<FromGitter> <girng> needs a nice blog post, i'll def read it. sounds inspiring IMHO
<FromGitter> <Blacksmoke16> ha, maybe if i ever finish this athena tutorial
<FromGitter> <sam0x17> oh yeah, eve could totally suck people into programming, and I know that by reputation having never played the game
<FromGitter> <Blacksmoke16> indeed
jemc has quit [Ping timeout: 245 seconds]
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c70cba75df86a45687d27f4]
<FromGitter> <Blacksmoke16> easy peasy
<FromGitter> <girng> :D
jemc has joined #crystal-lang
Raimondi has joined #crystal-lang
<FromGitter> <girng> https://play.crystal-lang.org/#/r/6ca6 i would need to have 5 different methods if i want to return a new tuple for all 5 indexes. is it possible to do it in one method?
jemc has quit [Ping timeout: 240 seconds]
<FromGitter> <girng> https://play.crystal-lang.org/#/r/6car BOOM got it!!
<FromGitter> <proyb6> Oh, V Lang claims to be design for AAA games to web service, coming in Mid 2019 ⏎ https://vlang.io/
DTZUZU has quit [Ping timeout: 268 seconds]
DTZUZO has quit [Ping timeout: 255 seconds]
<FromGitter> <girng> looks like golang or just me?
<FromGitter> <girng> (syntax wise)
DTZUZU has joined #crystal-lang
DTZUZO has joined #crystal-lang
<FromGitter> <proyb6> Yes, the author said it's similar to Go
<FromGitter> <proyb6> I think the team could get this opportunity to see how V Lang compiles instantly as its claim
<FromGitter> <girng> "Hot code reloading" i gotta c this lol
<FromGitter> <girng> looks interesting, thanks for sharing. i'll take a look at it in march for funzies
laaron- has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<FromGitter> <elorest> @mixflame How have you been?
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 240 seconds]
shmibs_ has joined #crystal-lang
early` has joined #crystal-lang
early has quit [Ping timeout: 1042 seconds]
shmibs has quit [Quit: leaving =o]
commavir has quit [Remote host closed the connection]
shmibs_ is now known as shmibs
Dreamer3 has quit [Ping timeout: 249 seconds]
Dreamer3 has joined #crystal-lang
ua has quit [Ping timeout: 246 seconds]
ua has joined #crystal-lang
<FromGitter> <mavu> My chatbot lives! It even greets me in Bot-ish. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c7117e8b6c74f1e2e99f7d5]
ashirase has quit [Ping timeout: 245 seconds]
ashirase has joined #crystal-lang
<FromGitter> <straight-shoota> @proyb6 Crystal would pretty much compile instantly if it didn't have its incredibly awesome type inference. A fully typed language like Go and V can avoid expensive semantic code analysis.
<FromGitter> <straight-shoota> And V seems to be nothing more than a website with a few claims at the moment. There is no code available, nor any detailed information.
<FromGitter> <straight-shoota> Even if everything's legit, I don't see any compelling arguments for this language compared to Go.
<FromGitter> <mavu> I don't understand this focus on compile times. Sure, its nice if stuff compiles instantly, or doesn't need to at all, but as long as it takes less than a minute, I'm more than fine with that.
<FromGitter> <j8r> The compilation takes also a lot of memory
<FromGitter> <mavu> Its 2019, I have 16gb memory in my 5 year old laptop
<FromGitter> <Jack30t> my problem is that the crystal tooling is currently incredibly bad, so your only option to reliably check for errors and stuff like that is recompilling, which is very slow
<FromGitter> <j8r> @mavu that's not about you, the CI is more expensive too
<FromGitter> <j8r> And also slower
<FromGitter> <straight-shoota> I don't think CI is a huge issue.
<FromGitter> <straight-shoota> Speed matters more for immediate developer experience.
<FromGitter> <straight-shoota> When you make a change in your code, you want to instantly know if it's good.
<FromGitter> <straight-shoota> Memory is also an issue, obviously. But it's relatively easy to throw more RAM at it, while speeding up processing speed soon hits a limit. Even parallelism probably wont bring huge improvements because many tasks are sequential.
<devil_tux> how about someone approve my forum post from days ago >.<
devil_tux has quit [Ping timeout: 268 seconds]
sz0 has joined #crystal-lang
Yxhuvud has quit [Ping timeout: 250 seconds]
Jenz has joined #crystal-lang
lucasb has joined #crystal-lang
<FromGitter> <PlayLights_twitter> Hello! morning all
<FromGitter> <Blacksmoke16> o/
<Jenz> Morning
<Jenz> (Though evening here)
<FromGitter> <PlayLights_twitter> Im currently defining a method but looks awful
<FromGitter> <PlayLights_twitter> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c7172b1b6c74f1e2e9c333a]
<FromGitter> <PlayLights_twitter> Is there any way to define the type in other part?
<FromGitter> <Blacksmoke16> why not use a class or struct
<FromGitter> <Blacksmoke16> where each property would be an ivar of the class
<FromGitter> <PlayLights_twitter> It could work, lets start with a struct, I was trying to simulate the "validates" method from rails
<FromGitter> <Blacksmoke16> to validate json?
<FromGitter> <Blacksmoke16> or just properties in genearl
<FromGitter> <PlayLights_twitter> something like
<FromGitter> <PlayLights_twitter> when validating a form, so you can validate a field called "price " for sample
<FromGitter> <PlayLights_twitter> like
<FromGitter> <Blacksmoke16> is the form from a front end coming in as JSON or part of the server rendered page?
<FromGitter> <PlayLights_twitter> `validates :price, presence: true, number: {greater_than: 10}`
<FromGitter> <Blacksmoke16> prob could make a macro to do that. like each macro adds a `Validator` struct or something to an array, then on init run all the validators
<FromGitter> <PlayLights_twitter> Yeah having an array of validators could work, thanks, im going to search for its implementation on rails core btw
<FromGitter> <Blacksmoke16> np
<Jenz> Anyone tried this new crystal book?
Dreamer3 has quit [Quit: Computer has gone to sleep.]
Dreamer3 has joined #crystal-lang
Dreamer3 has quit [Client Quit]
<FromGitter> <PlayLights_twitter> I read the beta version, but I didn't anything too advanced to learn from so I think it is more for new people on the language
<Jenz> Hmm, ok thanks
<Jenz> It's pretty expensive (to me), so I'm in doubt
Jenz has quit [Ping timeout: 255 seconds]
ylluminate has joined #crystal-lang
<FromGitter> <PlayLights_twitter> Maybe we are pointing different books
<FromGitter> <PlayLights_twitter> do you have a link?
<FromGitter> <girng> why doesn't `puts typeof(arr2)` display Int32.class?
<FromGitter> <bew> Why would it?
<FromGitter> <girng> array literal, just like a tuple literal
<FromGitter> <girng> but tuple literal, shows the .class
<FromGitter> <bew> Btw your tuple1 is not a tuple at all
<FromGitter> <bew> It's a type
<FromGitter> <bew> If you want a `Array(Int32.class)`, the literal would be `[Int32]`
<FromGitter> <bew> No idea you'd want that though
<FromGitter> <girng> @bew oh https://play.crystal-lang.org/#/r/6ceh
<FromGitter> <girng> yeah ,it shows .class now, thanks
<FromGitter> <bew> But do you understand why?
<FromGitter> <girng> type not a value
<FromGitter> <girng> ?
<FromGitter> <bew> Huh can you make a sentence (don't understand ^^)
<FromGitter> <girng> sorry, i mean it's a type not a value ([0] -> [Int32])
<FromGitter> <girng> that's why it's showing .class now?
<FromGitter> <bew> Hmm It's tricky because Int32 in this case is a value..
<FromGitter> <girng> Oh cause it's in the array lol
<FromGitter> <bew> In an expression, the type of `0` is Int32 and the type of `Int32` is Int32.class
<FromGitter> <bew> Yeah inside a literals it's always an expression
<FromGitter> <girng> @bew what transpired me to create that playground with the Array(Int32).new and [0] (not [Int32]) is from this post: https://github.com/crystal-lang/crystal-db/issues/98#issuecomment-466638140 and I was confused at first because [0] was not showing class, but doing [Int32] does.
<FromGitter> <girng> From your help, so it does make sense now. They are consistent
<FromGitter> <girng> I better understand it
<FromGitter> <girng> I was just confused at first because I used `[0]` instead. Which was an error on my part, should have used `[Int32]`
<FromGitter> <bew> In this comment, `ItemTuple` is a type (can be used the as a type / a restriction / type annotation) and `ItemTuple2` is a value (of type `Tuple(...)`)
<FromGitter> <girng> Thank the heavens for `.types` 😆.. I'd be a hot mess
<FromGitter> <girng> @bew you like the ternary operator? i love it: https://play.crystal-lang.org/#/r/6cer LOL
<FromGitter> <Blacksmoke16> oh my
<FromGitter> <Blacksmoke16> you know you can create a tuple from an array
<FromGitter> <girng> it's actually quite cool how this Tuple is working on my brain. For example, I've already started mapping the db columns to their index values (their tuple values). For example, `equipped` is index 4, `i_ms` is index `12`. They are slowly getting mapped in my brain like a Hash lookup
<FromGitter> <Blacksmoke16> assuming you know the types that each element will be
<FromGitter> <girng> Actually pretty cool IMO
<FromGitter> <Blacksmoke16> got a sample of using that replace method?
<FromGitter> <girng> @Blacksmoke16 they tuple uses this ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c718d497667931e2fec3b22]
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/6ceu not sure if that would be useful for you tho
<FromGitter> <girng> Oh, I was looking at `from` last night, that's cool
<FromGitter> <Blacksmoke16> but i still think a class/struct would make more sense
<FromGitter> <Blacksmoke16> then you could just do like `Item.health_percent = xxx`
<FromGitter> <girng> Yeah me too
<FromGitter> <Blacksmoke16> or even implement a method to convert it to/from a tuple
<FromGitter> <girng> But I tried that, and wrote out all the types in db.mapping, wrote custom to_json using io.raw, so the key values are not sent when .to_json is called, etc
<FromGitter> <girng> Had a problem somewhere last night and raged. Just went back to Tuples..
<FromGitter> <girng> But really, the items are stored in a Hash(Int64, ItemTuple).new.. player can have 100+ items in their inventory. I still think a Tuple would be better, but I could be wrong here
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/0.27.2/StaticArray.html of `Item` structs
<FromGitter> <girng> Cleaner code, don't need to use DB.mapping and list all 13 types (will have to add more types to that in the future when adding more db columns). Don't need to a custom to_json method with io.raw, that converts every single property into a delimited `,` list... ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Something like that is what I tried, seems too cumbersome IMO. As the Tuple already gets converted into
<FromGitter> <Blacksmoke16> fair enough
<FromGitter> <Blacksmoke16> could implement that in your struct tho
<FromGitter> <Blacksmoke16> so the struct gets serialized as an array like that when calling `to_json`
<FromGitter> <Blacksmoke16> but :shrug: whatever works for you
<FromGitter> <Blacksmoke16> always optimize it later
Jenz has joined #crystal-lang
<FromGitter> <girng> Yeah, i'd have to do a to_json similar to above even with a Struct though, right?
<FromGitter> <girng> Or can a struct shoot out delimited property values in a list like a Tuple can, not sure
<FromGitter> <Blacksmoke16> would have to be an override sec
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/6cex
<FromGitter> <Blacksmoke16> could also do liek
<FromGitter> <girng> Oh, another thing is ItemTuple.types is used for db.query_all `query` as: ItemTuple.types. Then ItemTuple is also used `property items = Hash(Int64, ItemTuple).new`. It just seems like the `ItemTuple` can be used everywhere, it feels powerful
<FromGitter> <girng> Cool @Blacksmoke16 i'll fiddle around with a Struct later tonight
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/6cf7
<FromGitter> <Blacksmoke16> if you can be assured the index of each property is going to be always the same could also do like
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/6cfj assuming you define the properties in the same order as the tuple values
<FromGitter> <Blacksmoke16> could also expand on that to have a class method like `from_result_set` where you pass it a result set and it can iterate calling `.read({{ivar.type}})` for each ivar to create an array/single object from the rs
<FromGitter> <Blacksmoke16> so your db query would magically create objects
<FromGitter> <girng> I see
lucasb has quit [Quit: Connection closed for inactivity]
<FromGitter> <Blacksmoke16> ```code paste, see link``` ⏎ ⏎ Something like that [https://gitter.im/crystal-lang/crystal?at=5c71950d7667931e2fec6f2f]
<FromGitter> <girng> Oh, nice. Passing DB::ResultSet to a method
<FromGitter> <Blacksmoke16> like would make a simple ORM that knows to return an array of `self` or just a single obj
<FromGitter> <girng> I never thought of that :O
<FromGitter> <Blacksmoke16> ye
<FromGitter> <Jens0512> :O
* Jenz was so amazed he used the wrong chat
<FromGitter> <Blacksmoke16> would ofc required that what you are querying from the table the columns in the same order as your properties are defined
<FromGitter> <girng> That's how I got confused with the dumb Array yesterday, lol
<FromGitter> <Blacksmoke16> which if you always want to just query everything just do like https://play.crystal-lang.org/#/r/6cfu
<FromGitter> <girng> I thought it was querying them in the order of the types in the Array 😆
<FromGitter> <Blacksmoke16> so then can just call like `{{@type}}.fields and will return array of strings to query in same order as properties
<FromGitter> <j8r> I submitted a post for help to work on a self-hosting project. Everyone's welcomed :) - https://forum.crystal-lang.org/t/seeking-help-of-passionates-of-web-and-self-hosting/465
<Jenz> @j8r second link in post has a trailing "-" resulting in 404
<Jenz> (Logo is cool :D)
<FromGitter> <j8r> fixed this markdown issue, thanks Jenz
<FromGitter> <j8r> Sometimes, we have to ask for help for projects that will become greater than us.
<FromGitter> <j8r> thanks Jenz, I remember to have designed it 2-3 years ago in Inkscape 😄
<Jenz> With all dem sexy curves of inkscape thing tends to get cool, and potentially extremely awesome
<FromGitter> <j8r> I strongly believe there is a business on self-hosting. Everyone could have a ready-to-use, cheap ARM board with like 1TB of disk space to host they music, movies, pictures.
<FromGitter> <Blacksmoke16> https://www.udoo.org/udoo-x86/ is what i host my stuff on
<FromGitter> <j8r> A competitor of HomePOd and NAS
<FromGitter> <Blacksmoke16> works pretty nice, could pretty easily setup like docker swarm/kubernetes as well
<FromGitter> <j8r> @Blacksmoke16 it costs too much
<FromGitter> <j8r> we can easily have a decent home cloud based on ARM for $30
<FromGitter> <Blacksmoke16> depends what you want to do with it, but yea is deff bit more pricey than pi or something
<FromGitter> <j8r> and, better to avoid k8s on ARM - 💀
<FromGitter> <j8r> even docker...
<FromGitter> <j8r> oh an old project
<FromGitter> <j8r> no, I just integrated it
<Jenz> Ah
<FromGitter> <j8r> I was passionate of web-only soft, so I made this site haha
<Jenz> Unfortunately, while passionate about packages, I'm not quite passionate enough to want to help out with dppm
<Jenz> Looks really cool though :D
<Jenz> (I like you're using CON)
<FromGitter> <j8r> i agree this is going to require a lot of work
<FromGitter> <j8r> Jenz you remind me I must rewrite the Crystal's JSON parser to benefit of the work done in CON
<Jenz> Oh? :O
<Jenz> There's been a lot of this and that about the json parser
<FromGitter> <j8r> yeah, CON and JSON are fairly close - CON is faster than JSON because of the implem'
<FromGitter> <j8r> mostly
<FromGitter> <j8r> an implementation with no `CON::Token`
* Jenz O_o
<FromGitter> <j8r> You work on myst-lang?! nice!
* Jenz :)
<Jenz> Been a while though
<Jenz> And not much
<Jenz> faulty does pretty much everything
<Jenz> (For those who haven't seen myst: https://github.com/myst-lang/myst)
<Jenz> ("A structured, dynamic, general-purpose language.")
Yxhuvud has joined #crystal-lang
<Jenz> We'd do well with some more people, we're pretty much in the same position as j8r I'd say
<Jenz> Interesting project I recommend everyone to take a look, credits to @faulty
<Jenz> Uh, just not that faulty
<Jenz> But @faultyserver :sweat_smile:
<FromGitter> <j8r> if you like Crystal interpreters: https://github.com/j8r/crystal-object-send
<FromGitter> <j8r> perhaps an REPL could be done with that...
<FromGitter> <j8r> i starred myst because, great work
<Jenz> apropos REPL and that shard of yours j8r: https://github.com/crystal-community/icr/issues/79
<Jenz> And thanks for the star :)
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
yllumina_ has joined #crystal-lang
laaron has joined #crystal-lang
ylluminate has quit [Ping timeout: 246 seconds]
<FromGitter> <j8r> I'm thinking... i can post a job to @vladfaust 's https://crystaljobs.org/ :)
<FromGitter> <j8r> @vladfaust with a dark-theme, it's hard to see the fields when posting a job https://imgur.com/a/wqT4S2h
<FromGitter> <j8r> maybe $100 per month, I should find someone 😏
<Jenz> I'm not sure if I'm doing this right: https://imagebin.ca/v/4Y33gh7vtxZW
<Jenz> Too many type overloads?
<FromGitter> <j8r> why there is "of"?!
<Jenz> Because then I can do `assert_validness! of: "this string"`
<FromGitter> <dscottboggs_gitlab> oh, I do that a lot
<FromGitter> <dscottboggs_gitlab> LOVE that feature
<Jenz> It looks really nice IMO
<Jenz> I only learned of it recently
<FromGitter> <j8r> really weird
<Jenz> Not used much in the stdlib
<FromGitter> <j8r> why not https://carc.in/#/r/6cge?
<FromGitter> <dscottboggs_gitlab> it's called "external named arguments or something
<Jenz> Though here: file:///usr/share/doc/crystal/api/Socket.html#send(message%2Ctoaddr%3AAddress)-instance-method
<FromGitter> <j8r> looks like another "good in paper but unnecessary in reality" feature
<FromGitter> <dscottboggs_gitlab> it just adds a little bit of extra niceness when reading it back, lets you make your code more self-documenting
<Jenz> j8r: because that's without the "in:" :D
<FromGitter> <dscottboggs_gitlab> Unnecessary? Certainly! But it's also useful
<Jenz> Especially with many arguments, it can be really useful to show what each arg actually is
<FromGitter> <j8r> hum, name them properly? lol :)
<FromGitter> <dscottboggs_gitlab> me and @Blacksmoke16 were talking about an idea I had a while ago to make a query engine based on that... like ⏎ ⏎ ```query where: some_arg, eq: value, sort_by: Columns::Column do |results| ⏎ ... ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5c71b471c776985d8f4027f7]
<FromGitter> <j8r> the example in docs showed by @Blacksmoke16 isn't really good
<FromGitter> <dscottboggs_gitlab> the last one is pretty nice, `increment value, by: amount`
<Jenz> Agree
<FromGitter> <j8r> https://carc.in/#/r/6cgf
<FromGitter> <j8r> I disagree, why not `def increment(value, amount)`?
<Jenz> j8r increment 10, by: 20 is more descriptive
<Jenz> Simply
<Jenz> And the external name is optional to use
<FromGitter> <j8r> that's strange to have `by` as positional argument, and sometimes not
<FromGitter> <j8r> depending of the method declarationn
<Jenz> With `def increment(value, by amount)`, you can still just do increment 10, 20
<FromGitter> <dscottboggs_gitlab> I combine it with required named arguements a lot too
<FromGitter> <j8r> ok for readability, not ok for beginners - that's confusing
<FromGitter> <j8r> this can easily be confused with classic named argument
<FromGitter> <dscottboggs_gitlab> for example, earlier, I wrote a class like... ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c71b5f49e430b3086b5fdbb]
<FromGitter> <dscottboggs_gitlab> obviously the types were more descriptive, but there were also more of them and I didn't feel like writing the whole thing out
<FromGitter> <dscottboggs_gitlab> I just like the freedom to be able to use these sorts of things and I don't see the point in arguing against the availabilty of them, they're great and useful when they come up.
<FromGitter> <dscottboggs_gitlab> Then again, before writing any crystal I read the gitbook front-to-back and not everyone will do that so I guess it's fair to not want to confuse people as much as possible
<FromGitter> <j8r> reading is one thing, remembering and properly use is another one
<FromGitter> <j8r> I'm more with KISS IP - keep it simple, stupid, if possible
<FromGitter> <j8r> limiting complex (or not) features make the code more homogeneous, simpler and faster compiler with less potential bugs
<Jenz> I don't think that syntax is complex at all O_o, not confusing either, I guess this is a question of personal taste
<FromGitter> <j8r> that's why i said, or not complex
<FromGitter> <dscottboggs_gitlab> he's simply advocating for simplicity, which I respect
<FromGitter> <j8r> even in the generated docs, the arguments looks weird - and didn't understand the API doc, and I code since 1.5 years in crystal -_-'
<FromGitter> <j8r> maybe the doc needs to be more explicit on this, dunno
<FromGitter> <j8r> or perhaps it is - my bad 😅
<FromGitter> <dscottboggs_gitlab> Yeah, if I use weird syntax like that, I always make an extra note of it in the docs with an example
<Jenz> I was suprised at first too, but I quickly grew very fond of this. I think it was only recently added to the book, as I haven't seen it there either
<Jenz> (before now)
<FromGitter> <dscottboggs_gitlab> Yeah, I don't think it was there when I initially read it...
<FromGitter> <j8r> at the end I don't really mind
<FromGitter> <j8r> it's isn't widely used anyway
<FromGitter> <j8r> Jenz I really appreciate the technological work on myst. But, I'm wondering - what is the main use case, compared to Lua (or TCL cc rkeene) or other scripting languages for instance?
yllumina_ has quit [Quit: Textual IRC Client: www.textualapp.com]
<FromGitter> <j8r> I'll be really careful to notice there is no comma in method args :|
<Jenz> In myst we strive for ease of use, not that it's very much so ATM, but we try. There's still loads and loads to be discussed, but we have a working language. I repeat "ATM" as stuff is likely to change, we try to make pattern matching and interpolation as readily avaible as possible: everywhere.
<Jenz> I've also tried to make it easily embeddable with crystal
<Jenz> Though I realize there's no docs for the embedding API, so there's no way people are gonna notice haha
<Jenz> I'll do a demo, sounds like fun
<Jenz> (Answer to: @j8r)
sagax has quit [Ping timeout: 246 seconds]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
sagax has joined #crystal-lang
<FromGitter> <j8r> Thanks for the explanations Jenz
<FromGitter> <j8r> So, versus Lua?
<FromGitter> <j8r> The main point is it's written in Crystal, maybe better, friendlier features?
Jenz has quit [Ping timeout: 246 seconds]
lunarkitty has joined #crystal-lang
<FromGitter> <aarongodin> hey all, question about using the HTTP::Client from the stdlib. Is my assumption right that calling a method from that class will halt code execution until the request is complete? Or is it executing that on the event loop or through a fiber internally?
<FromGitter> <aarongodin> The guide only states that "everything IO related" runs on the event loop, but I don't know if http would be considered "IO"
<FromGitter> <j8r> mps https://github.com/crystal-lang/crystal/pull/7477 is merged, in case you're interested. Either we have to make a patch to 0.27.2, or wait for 0.28.0