<FromGitter>
<whitenoiseoss> seems that @[Link("SDL")] is the same as #include <SDL.h> and setting the constants seems consistent with doing a #define
<FromGitter>
<Blacksmoke16> nice oen!
<FromGitter>
<Blacksmoke16> one*
_whitelogger has joined #crystal-lang
<FromGitter>
<dscottboggs_gitlab> is there any way to define a macro-scoped variable besides defining a constant? I tried `{% varname = value %}` and that didn't work...
<FromGitter>
<Blacksmoke16> yes but use `{% begin %} xxx {% end %}`
<FromGitter>
<dscottboggs_gitlab> hm, ok
<FromGitter>
<Blacksmoke16> i mean like wrap all your macro stuff in that
<FromGitter>
<Blacksmoke16> and should allow for that
<FromGitter>
<whitenoiseoss> Make working with JSON APIs in Crystal much easier <- yis
<FromGitter>
<Blacksmoke16> also built a web framework around it, works pretty good, although is a bit young
RX14 has joined #crystal-lang
Vexatos has joined #crystal-lang
<FromGitter>
<whitenoiseoss> athena?
<FromGitter>
<Blacksmoke16> yea
<FromGitter>
<whitenoiseoss> everything Crystal-related is "a bit young" :P
<FromGitter>
<Blacksmoke16> compared to kemal or amber i mean :p
<FromGitter>
<whitenoiseoss> I just got a new job at a Ruby shop as an engineer, and they are running Crystal in production for some analytics (because it's quick enough to do their analytics but is also very similar to Ruby)
<FromGitter>
<whitenoiseoss> and so uh
<FromGitter>
<whitenoiseoss> I'm a bit concerned about the maturity level of Crystal in that regard, I think there's going to be a lot of pioneering I have to do to build out all of the stuff they need.
<FromGitter>
<whitenoiseoss> but it's an interesting language
<FromGitter>
<Blacksmoke16> indeed
<FromGitter>
<Blacksmoke16> have a bog post on athena nearly ready, just waiting on some PRs to get merged to provide issue-less experience
<FromGitter>
<Blacksmoke16> is pretty slick i must say :P
<FromGitter>
<whitenoiseoss> i am sure you are an unbiased reviewer
<FromGitter>
<whitenoiseoss> but, it's worth a shot. i like having a rest api handy in any language i deal with
<FromGitter>
<Blacksmoke16> sec
f1refly has quit [Ping timeout: 264 seconds]
f1refly has joined #crystal-lang
<FromGitter>
<weirdbricks> hello folks, I'm having trouble with getting the inode of a file on Linux. I'm using Crystal 0.27.2 - I'm trying something like: `puts File.info(filename)` and I see this in the results: `@st_ino=3157687_u64`, however there seems to be no way to actually get that value. What's the easiest way to get the inode of a file in Crystal ?
_whitelogger has joined #crystal-lang
laaron has joined #crystal-lang
mps has quit [Ping timeout: 250 seconds]
<FromGitter>
<mavu> @weirdbricks You could use LibC.stat, and use the systemcall directly, that should be possible. ⏎ or you maybe you can monkeypatch File and add a getter for the @st_ino
<FromGitter>
<mavu> No idea if there is a better way, i'm new here :)
<FromGitter>
<yxhuvud> @j8r Don't #split have a block version that does what you want?
<FromGitter>
<j8r> @yxhuvud right. I can then return on the first block invocation, thx
mps has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter>
<drum445> I'm connecting to MySQL via: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ If MySQL is restarted on the server Crystal will return 500s like it can't reconnect. Does anyone know how to make crystal reconnect to mysql if the connection drops for a short while? [https://gitter.im/crystal-lang/crystal?at=5c73f0941f146304211a6ea2]
<FromGitter>
<j8r> there is no really point of using all of this in text, because `nuffin'` == 7chars and `nothing` == 7chars
<FromGitter>
<Sija> :D
<FromGitter>
<Sija> it ain't coding my dear ;)
<FromGitter>
<j8r> I didn't know `w8`, it saves chars
<FromGitter>
<Sija> that's just alternative, non-standard way of sayin' that
<FromGitter>
<j8r> writing, you w
<FromGitter>
<j8r> mean
<FromGitter>
<j8r> but this words are mostly spoken, not real written AFAIK
marmotini_ has quit [Ping timeout: 245 seconds]
<FromGitter>
<kinxer> It's a transcription of a way of saying the word we write as "nothing".
<FromGitter>
<Sija> @j8r for me "nuffin" sounds funnier than "nothing". and it rhymes with "muffin", yay! ;)
<FromGitter>
<kinxer> Since it's primarily a way of communicating the way the word sounds (a job which writing systems grow worse at as time goes on and language changes), it doesn't really need to conform to any writing rules.
<FromGitter>
<kinxer> But Sija's most recent description is a more reasonable way of looking at that. :P
<FromGitter>
<j8r> don't know... "If u spik lik zis", some can take what you said less seriously
<FromGitter>
<j8r> or simply don't understand :)
<FromGitter>
<Sija> yeah, well, I'll take my chances, I see nuffin' wrong with a pinch of salt in a good muffin ;)
<FromGitter>
<j8r> someone knows what the pros of `db.exec "insert into contacts values (?, ?)", name, num` vs ` db.exec "insert into contacts values (#{name},#{num}?)"`?
<rkeene>
Is the second one vulnerable to SQL injection, or does it know to quote it somehow ?
<z64>
yes, the former will prevent SQL injection, and DBs can optimize calls to prepared statements
<FromGitter>
<j8r> so vs `db.exec "... '#{name}'"`?
<rkeene>
What if name === "' -- DELETE FROM foo;" ?
<rkeene>
oops
<mps>
rkeene: yes, from my experience in other languages second version is risky because of possible SQL injections
<rkeene>
What if name === "'; DELETE FROM foo; -- '" ?
rohitpaulk has joined #crystal-lang
<mps>
first version should be safe, but I don't know for how it is implemented in crystal
<z64>
it isn't implemented in crystal; the database handles it
rohitpaulk has quit [Remote host closed the connection]
<mps>
and I will be unpleasantly surprised if it is not safe
<FromGitter>
<j8r> snap `wrong number of arguments for 'DB::Database#unprepared' (given 2, expected 0..1)`
<mps>
z64: right, I should write 'crystal DB drivers/shards'
<z64>
not crystal drivers/shards either.. its part of DB protocol. you send the template query, then the values, and the DB takes care of inserting them safely
<mps>
eh, right, but didn't wanted to go so deep. ;)
<mps>
j8r: asterite, straight-shoota, we updated Alpine stable and edge libxml2 with patch which fixes derefence bug
<mps>
now, crystal build and test passes, right now I'm testing on aarch64 complete rebuild of the 0.27.2
<FromGitter>
<j8r> mps you're awesome, thanks :)
sagax has quit [Ping timeout: 245 seconds]
<mps>
you are welcome. I don't think I'm it's my credit, we all (mentioned above) worked on it and solved it so credit and thanks belong to anyone who helped with it
<FromGitter>
<straight-shoota> 👍
<FromGitter>
<j8r> I'm a noob in SQL: is this correct `db.exec "ALTER USER 'root'@'%' IDENTIFIED BY ?", password`?
<FromGitter>
<j8r> or `db.exec "GRANT USAGE ON *.* TO ?@? IDENTIFIED BY ?", user, hostname, password`
<FromGitter>
<j8r> I don't think I nees this interpolation, i'll just use `#{}`. I already check if there is no space, only ascii letters and numbers before
return0e has quit [Ping timeout: 245 seconds]
return0e has joined #crystal-lang
sagax has joined #crystal-lang
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
lucasb has quit [Quit: Connection closed for inactivity]
blassin has quit [Ping timeout: 244 seconds]
blassin has joined #crystal-lang
lucasb has joined #crystal-lang
jemc has joined #crystal-lang
<FromGitter>
<bew> Hi RX14 I remember (from one of your live stream) that you have a special workflow around git, using worktrees to have multiple branch checked out at the same time, and wrote some tools around that.. I also use worktrees from times to time but only when needed and was thinking about doing something like you. I was wondering, did you ever do a post on your config? or did you base it on some other example setup I can
<FromGitter>
<GaryMiller> Has anyone benchmarked Crystal against Truffle Ruby. I didn't find any comparative benchmarks with Crystal but it looked a lot faster than JRuby and MRI on the ones I found. I was just looking at alternatives until the native Windows version of Crystal becomes available. I know new products tend to leapfrog each other over time in both performance and features but I was just trying to get a feel for the
<FromGitter>
... landscape of competing Rubys out there.
<FromGitter>
<j8r> I'll bet it's considerably faster, and use a lot less memory