ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.33.0 | 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> <andrewc910> Oh one last question! Any books to recommend? Something about low level but hopefully language agnostic.
<FromGitter> <tenebrousedge> a course: NAND to Tetris
<FromGitter> <stronny> Any assembler for beginners with examples
<FromGitter> <tenebrousedge> also, there's an interactive version of SICP if you want "low-level" in the mathematical sense
<FromGitter> <stronny> "low level" is vast actually
<FromGitter> <stronny> you know what, there is this game, human resource machine, it teaches the turing model quite well
<FromGitter> <andrewc910> Okay do Google these?:
<FromGitter> <andrewc910> And to Tetris ⏎ Assembler for beginners
<FromGitter> <stronny> hm?
<FromGitter> <tenebrousedge> NAND to Tetris
<FromGitter> <andrewc910> Interactive scip
<FromGitter> <andrewc910> And human resource machine?
<FromGitter> <andrewc910> Is that right?
<FromGitter> <tenebrousedge> yes
<FromGitter> <andrewc910> Nand to tetris. I wrote that. Stupid auto correct.
<FromGitter> <stronny> now for something completely different
<FromGitter> <stronny> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e64389aa2897318a9947158]
<FromGitter> <stronny> versus
<FromGitter> <andrewc910> Just needed to make sure I knew what I was suppose to Google lol
<FromGitter> <stronny> ```p "a".split "=" ⏎ p "a=".split "=" ⏎ => ⏎ ["a"] ⏎ ["a", ""]``` [https://gitter.im/crystal-lang/crystal?at=5e6438be80cc7b7924adb4b1]
<FromGitter> <andrewc910> Where is the `=` in the first example?
<FromGitter> <andrewc910> Whaaaaat
<FromGitter> <tenebrousedge> strange
<FromGitter> <andrewc910> I imagine '=' represents something other than what I am seeing.
<FromGitter> <stronny> it's just a character
<FromGitter> <stronny> ruby's String#split behaves different from Crystal's
<FromGitter> <tenebrousedge> I get `["1", ""]` for `"1=".split '='`
<FromGitter> <andrewc910> But idk why string#spkit behaves differently depending on the char. I don't believe split is aware if the string can be an integer.
<FromGitter> <tenebrousedge> oh, Ruby though
<FromGitter> <stronny> I though the IRB prompt would be visible enough, eh
<FromGitter> <stronny> I'll edit those
<FromGitter> <tenebrousedge> what's `irb`? `pry` for life
<FromGitter> <tenebrousedge> although I understand 2.7 brings those two much closer
<FromGitter> <stronny> apparently that's not a bug https://github.com/crystal-lang/crystal/issues/1070#issuecomment-132532095
<FromGitter> <fenicks> Hi guys
<FromGitter> <stronny> hey
<FromGitter> <fenicks> I read about free variables in Crystal documentstion but didn't understand the forall keyword meaning. I appreciate if you have lecture link or explanation.
<FromGitter> <stronny> basically you define a macro method that would not only work with any type, but you would also have that type in the T macro var
<FromGitter> <stronny> something like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e643ff2a2897318a9947d08]
<FromGitter> <stronny> which is exactly the same as ⏎ ⏎ ```def pt(arg) ⏎ puts arg ⏎ puts typeof(arg) ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5e6440518011bb652afc979a]
<FromGitter> <mondrian> I am testing the amber framework in macOS .
<FromGitter> <mondrian> The command amber new not generate the folder public/dist
<FromGitter> <mondrian> Can someone help me?
<FromGitter> <stronny> is there an error of any kind?
<FromGitter> <mondrian> no error
<FromGitter> <fenicks> @stronny ok got it thanks. Was thinking it was the case without specifying `forall`.
<FromGitter> <stronny> without `forall` you won't have the `T`
<FromGitter> <mondrian> just doesn't generate
<FromGitter> <stronny> no idea, sorry
<FromGitter> <mondrian> ok
<FromGitter> <stronny> https://docs.amberframework.org/amber/guides/directory-structure ⏎ it doesn't say about public/dist
<FromGitter> <stronny> should it exist at all?
<FromGitter> <stronny> beyond that they have their own channel https://gitter.im/amberframework/amber
<FromGitter> <stronny> maybe there is someone there at this time
<FromGitter> <mondrian> ok
watzon has joined #crystal-lang
<watzon> Well back to irc for me
<watzon> Let's see how long I stay
postmodern has joined #crystal-lang
<FromGitter> <tenebrousedge> "Mr. @watzon, come here &mdash; I want to see you."
<watzon> Lmao
dwdv has quit [Ping timeout: 265 seconds]
watzon has quit [Quit: WeeChat 2.7.1]
watzon has joined #crystal-lang
_whitelogger has joined #crystal-lang
JuanMiguel has joined #crystal-lang
_whitelogger has joined #crystal-lang
JuanMiguel has quit [Quit: This computer has gone to sleep]
watzon0 has joined #crystal-lang
watzon0 has quit [Read error: Connection reset by peer]
watzon has quit [Quit: WeeChat 2.7.1]
JuanMiguel has joined #crystal-lang
JuanMiguel has quit [Client Quit]
watzon has joined #crystal-lang
watzon has quit [Quit: The Lounge - https://thelounge.chat]
watzon has joined #crystal-lang
watzon has quit [Quit: The Lounge - https://thelounge.chat]
watzon has joined #crystal-lang
_whitelogger has joined #crystal-lang
ur5us has joined #crystal-lang
ravenx has joined #crystal-lang
alexherbo2 has joined #crystal-lang
ur5us has quit [Ping timeout: 256 seconds]
ur5us has joined #crystal-lang
_whitelogger has joined #crystal-lang
ur5us has quit [Ping timeout: 256 seconds]
Welog has joined #crystal-lang
<FromGitter> <Acciaiodigitale> Hi pals! There is someone working there: https://crystal-lang-tools.github.io/ ?
<FromGitter> <Acciaiodigitale> I know only @faustinoaq that is no more actively following his excellent project like the VSCode plugin
<FromGitter> <Acciaiodigitale> I want to help
_whitelogger has joined #crystal-lang
dwdv has joined #crystal-lang
JuanMiguel has joined #crystal-lang
JuanMiguel has quit [Quit: Saliendo]
<postmodern> do Pointer(...).malloc pointers get LibC.free'd when GC collects them?
ua has quit [Ping timeout: 258 seconds]
ua has joined #crystal-lang
JuanMiguel has joined #crystal-lang
JuanMiguel has quit [Remote host closed the connection]
<FromGitter> <asterite> yes and no
<FromGitter> <asterite> they don't go through libc
<FromGitter> <asterite> they essentially do gc_malloc
<FromGitter> <asterite> so they are tracked by the gc
<FromGitter> <asterite> undead robot: the split difference is intentional
<FromGitter> <asterite> there's remove_empty option in Crystal which is false by default
<FromGitter> <asterite> the default in Crystal is so when you join the result you get the initial string
<FromGitter> <stronny> yes, I've read the rationale thanks
<FromGitter> <stronny> I guess my complaint is that it's somewhat inconvenient to do `a,b=str.split(sep, 2)` that would raise if there is no sep in str.
<oprypin> so is that bad? i dont get it
<FromGitter> <stronny> I think would rather deal with nil there
<FromGitter> <tenebrousedge> use a regex and capture groups then?
<FromGitter> <stronny> why?
<FromGitter> <tenebrousedge> because then you're matching what you want rather than what you don't want
<FromGitter> <stronny> sorry, I don't follow
<FromGitter> <tenebrousedge> `"1=".match(/(?<a>.)=(?<b>.)?/)`
<FromGitter> <stronny> I would like a method like `fix_split(sep, size) : Array(String)` that would return an array with a fixed size == `size`
<FromGitter> <stronny> or even `: StaticArray(String, size)` though I'm not sure compiler would understand
<FromGitter> <stronny> just a thought though, I'm not advocating for stdlib expansion here
<FromGitter> <drum445> @Blacksmoke16 how do you enable sessions in Athena?
olbat has joined #crystal-lang
<FromGitter> <asterite> there's partition too
<FromGitter> <stronny> oh, that's right
_whitelogger has joined #crystal-lang
<FromGitter> <stronny> or at least do something like `{{ find_class(MyClass) }}` ?
<FromGitter> <Blacksmoke16> what would it return?
<FromGitter> <stronny> TypeNode
<FromGitter> <Blacksmoke16> @drum445 what are you trying to do exactly? There's currently not anything built in for that, but probably be pretty trivial to create depending on your use case
<FromGitter> <stronny> I think you can do that from a macro in Object and recursive #subclasses search, but it doesn't look clean
<FromGitter> <Blacksmoke16> +
<FromGitter> <Blacksmoke16> oops
<FromGitter> <Blacksmoke16> prob could create something with https://github.com/crystal-lang/crystal/pull/8836
<FromGitter> <stronny> nevermind, I'll go another way
<FromGitter> <Blacksmoke16> but couldnt you just do like `MyClass`?
<FromGitter> <Blacksmoke16> because its already a typeNode?
<FromGitter> <Blacksmoke16> versus trying to find it
<FromGitter> <stronny> oh, you're right
<FromGitter> <stronny> okay then, suppose I have `def main; end` in the top level, how do I get that?
<FromGitter> <Blacksmoke16> could use `@type`
<FromGitter> <stronny> from a macro inside another class?
<FromGitter> <Blacksmoke16> as at the top level it would refer to the top level, however it would also include other methods
<FromGitter> <Blacksmoke16> idt you can
<FromGitter> <Blacksmoke16> sec
<FromGitter> <Blacksmoke16> yea i dont have any ideas for that
<FromGitter> <stronny> me neither
<FromGitter> <stronny> but no problem, I can live without that
<FromGitter> <Blacksmoke16> they get defined in a `<Program>` type that you cant reference by name
<FromGitter> <Blacksmoke16> nor alias to
<FromGitter> <stronny> yeah
<FromGitter> <drum445> @Blacksmoke16 auth system, something similar to kemal-session
<FromGitter> <stronny> maybe something indirect with `method_added`? too complex though
<FromGitter> <Blacksmoke16> @drum445 for server rendering stuff? or as an API with separate front end
<FromGitter> <drum445> either reall
<FromGitter> <drum445> really*
<FromGitter> <Blacksmoke16> i added you to the athena ch
<FromGitter> <drum445> cheers
<FromGitter> <Afront> why does this work: ⏎ ⏎ ```foo = { ⏎ :one => 1 ⏎ } ⏎ ⏎ foo.delete 2 || raise "hi"``` [https://gitter.im/crystal-lang/crystal?at=5e65118ff046a30bbe4e9974]
<FromGitter> <Afront> I just realized I can use `foo.delete(2) {raise "hi"}`, but I would like to know why the second example doesn't work
<FromGitter> <Blacksmoke16> `foo.delete(2) || raise "hi"`
<FromGitter> <Afront> Oh precedence, I didn't realize that ⏎ Thanks
<FromGitter> <Blacksmoke16> yea, before it was doing `foo.delete(2 || raise "hi")`
<FromGitter> <tenebrousedge> parens are your friends
postmodern has quit [Quit: Leaving]
_ht has joined #crystal-lang
<watzon> Who runs the IRC bot? oprypin?
DTZUZU has quit [Ping timeout: 256 seconds]
DTZUZU has joined #crystal-lang
alexherbo2 has quit [Remote host closed the connection]
return0e has quit [Remote host closed the connection]
alexherbo2 has joined #crystal-lang
return0e has joined #crystal-lang
alexherbo2 has quit [Client Quit]
travis-ci has joined #crystal-lang
travis-ci has left #crystal-lang [#crystal-lang]
<travis-ci> crystal-lang/crystal#f97b6b6 (master - IO: Set fd to -1 on closed File/Socket (#8873)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/659863717
<DeBot> https://github.com/crystal-lang/crystal/pull/8873 (IO: Set fd to -1 on closed File/Socket)
yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
yxhuvud has joined #crystal-lang
travis-ci has joined #crystal-lang
<travis-ci> crystal-lang/crystal#1334e76 (master - Compiler: don't say "undefined method" on abstract leaf types (#8870)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/659878495
travis-ci has left #crystal-lang [#crystal-lang]
<DeBot> https://github.com/crystal-lang/crystal/pull/8870 (Compiler: don't say "undefined method" on abstract leaf types)
ur5us has joined #crystal-lang
return0e_ has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
return0e has quit [Ping timeout: 256 seconds]
yxhuvud has quit [Ping timeout: 240 seconds]
return0e_ has quit [Ping timeout: 240 seconds]
return0e has joined #crystal-lang
<oprypin> hi, watzon
<watzon> Heya!
<oprypin> watzon, well... yea, it's me running the IRC bot
<oprypin> the bridge bot only. the other one is jhass (at least in the past and very likely now)
_ht has quit [Remote host closed the connection]
<FromGitter> <stronny> who's on packaging the Crystal debs? would it be possible to fix the control fields? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e656a518e4239695776d940]
<watzon> Ok cool. I'm just trying to figure out what it would take to set up a bridge for the luckyframework gitter.
<FromGitter> <stronny> and by the way, the installation page may be improved a bit, at least drop the `https` scheme from sources
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
<oprypin> watzon, oh i can just run it
<watzon> Oh that would be awesome. I made a channel at #luckyframework
<oprypin> send me a message with some proof of ownership
<watzon> What would be the easiest way to do that?
<oprypin> uh probably approval from one of https://github.com/orgs/luckyframework/people
<watzon> I can do that