sz0_ has quit [Quit: Connection closed for inactivity]
<RX14>
this is probably the closest you're going to get to avoiding classes (until you're up to speed in the basics)
<RX14>
then you can start using classes
<RX14>
module and extend self basically gives you the feeling that everything inside the module is at the top level
<RX14>
but you have access to class vars like @@users still
jxv has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter>
<Dillybob1992> oh cool, thanks for sharing that :) im really actually like classes now honestly though, i think it helps with organization
<FromGitter>
<Dillybob1992> (from what i had before!)
jxv has quit [Client Quit]
<FromGitter>
<Dillybob1992> so for new modules it's .start, and new classes, it's .new?
rohitpaulk has quit [Ping timeout: 240 seconds]
<RX14>
@Dillybob1992 no
<RX14>
i just renamed your method "start"
<RX14>
if you renamed def start to def foo
<RX14>
it'd be GameServer.foo
<RX14>
also, the "extend self" is a bit of magic I should explain:
<RX14>
extend self is just a shortcut which means you don't need to put self. before all the method names
<FromGitter>
<Dillybob1992> ohhh, i see
<RX14>
and self. is the syntax for declaring "global methods" on the containing object
<RX14>
so def self.foo inside class Foo means you can call Foo.foo
DTZUZO has quit [Quit: WeeChat 2.0]
<RX14>
and it works the same for modules too
<FromGitter>
<Dillybob1992> awesome, thank you for the explanation and information helps a lot.
<FromGitter>
<Dillybob1992> really understand it a lot better
<FromGitter>
<marksiemers> @Dillybob1992 - RX14 is a great resource. When you catch him on here with time, there is probably no better way to get an answer. ⏎ When there isn't anyone available, you can reference the docs on Modules for help: https://crystal-lang.org/docs/syntax_and_semantics/modules.html
<RX14>
you know, flattery won't make me implement the features you want faster ;) @marksiemers
galstar[m] has quit [Ping timeout: 276 seconds]
galstar[m] has joined #crystal-lang
<FromGitter>
<Dillybob1992> thanks, yeah awesome community
jxv has quit [Quit: zzz…]
<FromGitter>
<marksiemers> I know RX14, I'm just trying to make sure you don't hate me for all the back-and-forth on those TechEmpower benchmarks. ⏎ There aren't really any features that I'm waiting on - just better db driver performance. Which I don't think you plan on working on anyway.
<FromGitter>
<fridgerator> is it possible to use `crystal_lib` to autogenerate bindings for a .h file that includes Objective C types?
<FromGitter>
<marin117> Then I have to change half of my application :(
<FromGitter>
<bararchy> well, if you depend on cli parsing, I would suggest using one of the robust tools made for it, else, you can think on how to re-invent the wheel in your application
<jokke>
marin117: why not do it like every other cli application and provide the flag with every param: -f a -f b -f c -f d -g
<jokke>
so you can use it like this: --long-f={a,b,c,d} -g
<FromGitter>
<marin117> I could that yeah
<FromGitter>
<marin117> didn't think about it
<FromGitter>
<marin117> thank you :)
cbass has joined #crystal-lang
<jokke>
then in your handler you'd have to do something like: parser.on("-n ARG", "--long-n=ARG") { |arg| n_args << arg }
<jokke>
afaik it get's called multiple times with all the values
<FromGitter>
<marin117> nice
<FromGitter>
<marin117> thank you
<FromGitter>
<marin117> you helped me a lot :)
<jokke>
glad to hear that :)
alex`` has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
alex`` has quit [Quit: WeeChat 1.9]
alex`` has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter>
<bew> Is there any Crystaler in the area of LosAngeles or SanDiego? I'm moving there for 7 month, maybe we could meet ;)
<Groogy>
Oh I have an old childhood friend who lives in San Diego
<Groogy>
Pilot
<Groogy>
If pilot ever introduces themselves as "Johannes Runström" then get off that plane ASAP
<FromGitter>
<bew> Lol why? It's him?
alex`` has quit [Remote host closed the connection]
alex`` has joined #crystal-lang
<Groogy>
yes
<FromGitter>
<bew> I'll be careful ˆˆ it starts with 2 hours delay for now ><
<Groogy>
so why you moving to there?
<FromGitter>
<bew> My 4th year at school is abroad, so I'll be in university there :)
<ua>
hmm is there any particular reason i cant do "blah".to_sym or Symbol.new("blah) ?
<ua>
why i cant do *
<FromGitter>
<bew> Symbols are compile time only, you cant create a symbol at runtime
<ua>
coming from ruby im triping over so many things i have to start collecting them lol
<FromGitter>
<bew> Each symbols will be replaced by an integer for runtime, so all symbols must be known at compile time
<FromGitter>
<bew> Ahah yes, it's a good idea
<jokke>
hey
<jokke>
is it possible to use (seemingly) blocking io read calls that don't actually read anything but rather return whenever something can be read from the IO?
<jokke>
this could be useful for using C libs that do blocking IO
<FromGitter>
<bararchy> you can IO.read for 1 byte, then IO.rewind
<jokke>
barachy: you cannot always rewind
<FromGitter>
<bararchy> well, evenloop already let you read whenever you have something to read
<FromGitter>
<bararchy> else it will simulate blocking
<jokke>
yes
<jokke>
but that won't work if the C lib does the reading
<jokke>
then the lib blocks the entire thread and thus the event loop
<jokke>
with a IO#wait_for_read you could wrap those lib calls
<jokke>
barachy: so bytes = Bytes.new(0); io.read(bytes) would always return immediately/
<jokke>
?
<jokke>
seems so
OceannBoy has quit [Ping timeout: 264 seconds]
<FromGitter>
<ArtLinkov> Btw @bararchy you asked before if I would mind mentoring for using SHAInet. Of course I would love to do it if someone is interested ;)
<FromGitter>
<bararchy> @ArtLinkov It's regarding Google Summer of Code, you can see issue #5562 , this is a project from google to help opensource comminities etc.. ⏎ It means you would need to mentor a student for 2-3 months of work (ie, coding SHAInet etc..)
<crystal-gh>
[crystal] ysbaddaden opened pull request #5565: Fix: decode DWARF line sequences with single program entry (master...fix-core-debug-dwarf-line-numbers-parser) https://git.io/vNY2f
mark_66 has quit [Remote host closed the connection]
<crystal-gh>
[crystal] ravernkoh opened pull request #5566: Standardize naming of Exceptions and Errors. (master...standardize-error-naming) https://git.io/vNYaw
<crystal-gh>
[crystal] bcardiff pushed 1 new commit to master: https://git.io/vNYK0
<crystal-gh>
crystal/master 048f77e Julien Portalier: Fix: decode DWARF line sequences with single program entry (#5565)...
<oprypin>
bararchy, "not invented here". in that phrase used as a substitute for "rewriting"
<FromGitter>
<bararchy> Oh, I see
<FromGitter>
<bararchy> thanks
<RX14>
well it's more than that
<oprypin>
it is more but you used it inappropriately :p
<RX14>
it comes from "not inveted here syndrome"
<RX14>
which is basically when a developer or ogasnsization tends to reject solutions they didn't write themselves
<RX14>
but yeah I was using it colloquially to just mean rewriting
rohitpaulk has quit [Remote host closed the connection]
<FromGitter>
<bararchy> I really wish @ysbaddaden 's GC to be here already, I really hate our current one.
<RX14>
why?
<oprypin>
there was a company that just disabled GC and opted to instead occasionally restart their services :p
<RX14>
i think that expecting it to be amazingly better is just wrong
<RX14>
oprypin, yeah i don't think thats really possible given today's allocation rates
<RX14>
you'd get maybe 10 http requests into 8gb ram
<oprypin>
O_O
<oprypin>
i dont believe you
<RX14>
ok maybe 10 is too few
<oprypin>
off by like 4 orders of magnitude, no biggie
<RX14>
doubt it's 4 orders of magnitude
<FromGitter>
<bararchy> Beacuse it has the potential to totally crash my program without any way I can rescue it, and it sigfaults on wierd configurations that I need to re-compile the GC if I want ot avoid
<RX14>
like a lot
<RX14>
@bararchy what are you *doing* to the GC
<FromGitter>
<bararchy> XD
<RX14>
it's been stable as a rock to me
<FromGitter>
<bararchy> are you using Arch ?
<oprypin>
tbh on low memory crystal just dies and that's it
<oprypin>
for sure. neural networks write a lot of data in arrays but they dont need to be new arrays all the time!
<FromGitter>
<bararchy> Floats ?
<oprypin>
floats dont use GC
<FromGitter>
<bararchy> IDK then ... ⏎ The fix is to ⏎ build boehmgc with enableLargeConfig = true
<oprypin>
no, thats the kludge
<FromGitter>
<bararchy> kludge ?
<RX14>
incorrect fix applied to mask the problem not solve it
<FromGitter>
<bararchy> I guess, but the error dosen't tell me too much
<FromGitter>
<bararchy> what does it mean "too many heap sections"?
<RX14>
too many objects
<RX14>
lol
<oprypin>
you might guess that it means too many heap allocations
<FromGitter>
<bararchy> I sometimes need 1k arrays with 200 floats, etc..
<RX14>
tbh oprypin it probably means too many mmaps
<FromGitter>
<bararchy> is this too much ?
<RX14>
depends how often you need them
<FromGitter>
<bararchy> sometimes even more
<oprypin>
bararchy, no it isnt, but i bet that you keep recreating them
<FromGitter>
<bararchy> I keep cleaning them too :)
<oprypin>
it's not a problem of how many arrays you have at once, it's how many you create
<FromGitter>
<bararchy> I never reach high RAM, always around 8-12gb
<oprypin>
ok, besides being actually pretty damn high, what does this have to do with the problem at hand?
<FromGitter>
<bararchy> not sure :)
<FromGitter>
<bararchy> so, you say I create too many objects too fast ?
<FromGitter>
<bararchy> it's not the overall numbers of array, but how often I create them ?
<oprypin>
yes
<oprypin>
you know how you write a = [1,2,3]; return a.filter{}.map{}.reject{} that's 4 arrays right there
<oprypin>
put that in a loop and it's multiplied
<FromGitter>
<bararchy> well, I create lots of arrays really fast, the Neural network works on matrixes etc..
<FromGitter>
<bararchy> lots of maps, finds, max, etc.
<FromGitter>
<bararchy> also sum
<oprypin>
out of those only map is relevant
<FromGitter>
<bararchy> I see
<oprypin>
and basically it should be `map!`
<FromGitter>
<bararchy> and select I guess
<oprypin>
or reading from one array and writing to another one manually
<FromGitter>
<bararchy> map will change current array instead of creating new one?
<FromGitter>
<bararchy> ^ oh
<FromGitter>
<bararchy> yeha
<oprypin>
as for select -- you basically need to rework the code to not use it
<FromGitter>
<bararchy> XD
<oprypin>
you probably use it to filter out some data then do a quick calculation on that data and immediately throw it away
<oprypin>
let's say you do `.select{}.sum` - instead have a loop `sum = 0; array.each |x| if condition; sum += x`
<oprypin>
it's unfortunate that you have to avoid such nice language features but it is what it is
<oprypin>
and don't forget that removing these allocations also enables you to do parallelism as i mentioned
<oprypin>
but that's beside the point
<FromGitter>
<bararchy> Yeha, working on that, trying to get it not to crash :\
<oprypin>
of course, before going with an axe on your code you should do profiling first -- figure out which spot does the most wasteful allocations an optimize that
<oprypin>
bararchy, if the lib is designed from the ground up with those allocations, maybe parallelism is not worth trying for now
<FromGitter>
<bararchy> I can work on the code thats for sure, but, when someone will go very "deep", and lots of neurons and layers, it will reach critical allocations again even if optimized
<oprypin>
but you still can optimize hot spots for GC
<RX14>
oprypin, actually, I think we're wrong on this one
<FromGitter>
<asterite> that's with xcode's instruments tool
<FromGitter>
<asterite> it seems transpose takes most of the time/allocation
<FromGitter>
<asterite> transpose allocates a whole new memory
<FromGitter>
<asterite> and I see it's just used for `each` and then computing max, so maybe there's a more efficient way to do that
<FromGitter>
<asterite> once you do that, you run the profiler again and check where's the time, optimize, repeat
<FromGitter>
<asterite> (I move that single spec to a foo.cr file)
<FromGitter>
<asterite> Plus in that method there's 4 tranpose
<FromGitter>
<bararchy> Oh cool
<FromGitter>
<bararchy> is this tool for Linux too ?
<RX14>
no
<FromGitter>
<asterite> no, but I think there are similar tools
<RX14>
on linux you have kcachegrind
<RX14>
(which is better)
<RX14>
you don't get the fanciness but you do get much more detail
<RX14>
@asterite do you get instruction-level profiling with instruments?
<FromGitter>
<asterite> ummm... what's that?
<RX14>
you see the disasembly
<RX14>
and the amount of times the instruction was executed etc
<FromGitter>
<asterite> i'm not sure, or I can't find it :-)
<RX14>
well with callgrind you're running the whole thing in a VM
<RX14>
so for every single instruction you get the number of times it was hit
<RX14>
the estimated cycle counts
<RX14>
hit rates for each cache per-instruction
<RX14>
and obviously per source line too
<RX14>
it's super detailed
<FromGitter>
<asterite> awesome
<FromGitter>
<asterite> Yeah, maybe it's available in Instruments but I can't find it
<RX14>
probably not tbh
<FromGitter>
<asterite> On the other hand, every time I wanted to optimize something (someone was complaining that something was slow in their crystal project) with just doing what I explained above I was able to optimize it a lot
<RX14>
the downside is that it runs literally 100+ times slower than realtime
<RX14>
so your 1s benchmark becomes 100s
<FromGitter>
<asterite> and usually it was just one or two things that had to change, so that's really good :-)
<RX14>
and your 20 second compile becomes half an hour
<FromGitter>
<asterite> Oh, I don't care if it takes longer as long as it gives me more data
<RX14>
i imagine you can use callgrind on osx
<RX14>
although i did have to heck it a bit to get intel asm syntax
<RX14>
because gas syntax sucks
<FromGitter>
<bararchy> @asterite I don't think I can get away from transpose :/ or I will need to do the exact same thing manually
woodruffw has quit [Ping timeout: 260 seconds]
<FromGitter>
<asterite> yes, you have to do it manually, or write a method `transpose_each` that does it manually
<FromGitter>
<asterite> and then probably compute the maximum value manually too
<FromGitter>
<asterite> that's the beauty of Go: if you had written this in Go you had done it manually because you have no other way :-P
woodruffw has joined #crystal-lang
woodruffw has quit [Changing host]
woodruffw has joined #crystal-lang
<FromGitter>
<asterite> no expensive abstractions
<FromGitter>
<bararchy> 😢
<RX14>
you don't even need to allocate do you
<RX14>
you're just transposing then immediately running an .each?
<FromGitter>
<bararchy> Yeha XD
<RX14>
surely it's clear you can just iteratively do that by index
<RX14>
it's a 2d matrix
<FromGitter>
<bararchy> This one is, ConvLayer is 3d
<RX14>
for each i; compute max of arr[i][...]
<RX14>
for each j; compute max of arr[...][j#]
<RX14>
@bararchy well transpose is 2d
<FromGitter>
<bararchy> I'll itirate it , let's see benchmark speed changes
<RX14>
also @bararchy
<RX14>
at the very least don't use transpose twice in a row
<RX14>
@inputs.transpose lines next to each other
<RX14>
actually whyyy
<RX14>
surely it's clearly faster to call @inputs.transpose once
<RX14>
the least you can do is @inputs.transpose.each { |a| i_max << a.max; i_min << a.min }
<RX14>
no backlash? even I thought it was a stupid article
<FromGitter>
<marksiemers> Do you consider yourself a Ruby-ist?
<RX14>
i guess that's a bit harsh
<RX14>
but there are some factual errors
<FromGitter>
<marksiemers> Probably should have let you in on the review process, some guys at Manas and Amber looked it over.
<FromGitter>
<marksiemers> What did we miss?
<FromGitter>
<sdogruyol> @RX14 stupid article? That's a bit harsh
<RX14>
yeah it was, i'm sorry
<FromGitter>
<marksiemers> No worries
<FromGitter>
<marksiemers> You weren't my target audience by any stretch. I'm interested in what I missed though.
<RX14>
well to me I think the people who find it hardest to learn crystal are rubyists
<RX14>
the syntax is the same, cool
<FromGitter>
<eliasjpr> I like what I read on reddit, the artlicle is generating the debate that is necessary, we can all learn from all the touch points
<RX14>
but dynamic typing vs static typing? learning a new syntax is really really easy compared to learning how static typing works
<RX14>
syntax is just how to type
<RX14>
going ruby to crystal you need to change how to think
<FromGitter>
<eliasjpr> Agree
<RX14>
and that'n never easy
<RX14>
I dislike hugely the "crystal is easy for rubyists" messaging
<FromGitter>
<eliasjpr> > **<RX14>** going ruby to crystal you need to change how to think ⏎ @RX14 did you post that on reddit? I think you should
<RX14>
because by seeing someone who has only used ruby come into the channel that idea is instantly expelled
<RX14>
plus the title is clickbait
<RX14>
just saying
<FromGitter>
<marksiemers> Isn't that what blog post titles are supposed to be?
<RX14>
depends what you want to do
<RX14>
inform people, or spread propaganda
<FromGitter>
<eliasjpr> Beware that Crystal gives that impression "easy for rubyists” and while is stactically typed and compiled, the syntaxt similarities also causes the effect of makind it easier to understand how Crystal works
<FromGitter>
<marksiemers> Agreed on the point about learning static-typing will be a challenge. ⏎ I consider myself a Ruby-ist for sure, but it wasn't my first language, so the idea of static-typing and method overloading (and native types) isn't brand new like it may be for a lot of Ruby-ists.
<FromGitter>
<Fryguy> I have to disagree ... I come from a 10-years-of-Ruby-experience background and Crystal was the fastest language I've ever picked up
<FromGitter>
<Fryguy> Mainly because the standard library is nearly identical except for duplicate methods
<RX14>
@Fryguy what languages other than ruby had you used before crystal?
<FromGitter>
<Fryguy> C, C#, Java, VisualBasic
<RX14>
yeah
<FromGitter>
<Fryguy> (a bunch)
<RX14>
crystal is really easy to pick up if you've learnt ruby AND a statically typed language
<FromGitter>
<Fryguy> that's fair
<RX14>
because you learn the syntax and stdlib from ruby
<FromGitter>
<eliasjpr> For Rubyists that have never worked with a compile language there is a painful lurning curve
<RX14>
and the semantics from a static language
<FromGitter>
<Fryguy> the stdlib mostly matching was a huge boost for me
<FromGitter>
<Fryguy> because I didn't have to "figure out" what the map method was
<FromGitter>
<eliasjpr> those who come from languages like java, c# c, wil just need to learn the syntaxt
<FromGitter>
<asterite> we are still in time to change the syntax so it doesn't look like ruby ;-)
<FromGitter>
<marksiemers> > I dislike hugely the "crystal is easy for rubyists" messaging ⏎ The tagline of the language is a problem regarding this sentiment: "Fast as C, slick as Ruby."
<RX14>
@asterite I love the syntax
<FromGitter>
<eliasjpr> > we are still in time to change the syntax so it doesn't look like ruby ;-) ⏎ Say what!
<RX14>
I think ruby is the second best language syntactically
<RX14>
after crystal
<FromGitter>
<asterite> well, would you say elixir looks like ruby?
<RX14>
not as much as crystal
<FromGitter>
<eliasjpr> I almost spilled coffee all over the laptop
<RX14>
and it goes in the wrong direction:
<FromGitter>
<asterite> and that's goo
<FromGitter>
<asterite> good
<RX14>
elixir adds more symbols
<FromGitter>
<Fryguy> honestly the hardest thing for me to learn what that I had to use local variables to trim down a union type (as opposed to calling a proprty twice like I would in Ruby)
<FromGitter>
<asterite> you start coding elixir and you immediately realize it's nothing like ruby
<FromGitter>
<eliasjpr> @asterite eleixir feel like ruby
<FromGitter>
<asterite> but that doesn't happen with crystal... you can pretend it's ruby but it's not, but the syntax is too deceiving
<FromGitter>
<Fryguy> I mean, I understood *why* right away, but remembering to do it and then seeing that was the problem when I got an error took me a while
<FromGitter>
<eliasjpr> is not by all means like ruby
<RX14>
@asterite the only reason to change the syntax away from ruby would be to change the impression of newcomers
<FromGitter>
<marksiemers> I think this a great point though - about people who only know Ruby (and may JS) then come to crystal and are lulled into a sense of knowing how to use the language.
<FromGitter>
<asterite> in Manas many times we said in the past: let's stop saying this language has any connection with Ruby
<FromGitter>
<Fryguy> yeah Elixir is nothing like Ruby...that was a bigger fallacy to me than the Crystal/Ruby comparison
<RX14>
and communities optimizing for newcomers over people who already use the language is a bad idea
<FromGitter>
<asterite> but I guess it's inevitable because syntax-wise it does look like Ruby... I wouldn't say the same regarding elixir (defmoudle, destructu, def ... do, if ... do, etc.)
<FromGitter>
<eliasjpr> why would you want to change the syntaxt isn’t the syntaxt on of the source of inspiration for prototyping Crystal in the first way
<FromGitter>
<eliasjpr> 😠
<FromGitter>
<eliasjpr> :)
<FromGitter>
<Fryguy> Ruby is "beautiful" and for me that makes it easier to read and understand...I get that exact same feeling out of Crystal
handicraftsman has joined #crystal-lang
<FromGitter>
<eliasjpr> Crystal is what I wanted every since I was born - there you go
<FromGitter>
<asterite> wow
<FromGitter>
<asterite> well, it was just a theoretical proposal with a ";)" smiley
<FromGitter>
<asterite> but yes, ruby syntax is really nice
<FromGitter>
<Fryguy> yeah, Crystal is the language I have always wanted as I've been progressing through my career
<FromGitter>
<marksiemers> Crystal seems to me, you can do a lot just writing nearly-ruby code, but then when you need more (overloading, access to native types, etc.), you can have it.
<FromGitter>
<asterite> sometimes it looks too terse, though
<RX14>
I like that crystal is basically ruby with the "fat trimmed"
<RX14>
like for, gone
<FromGitter>
<Fryguy> yeah, but it never seem to get to Perl-level terseness :)
<RX14>
post-fix while, gone
<FromGitter>
<marksiemers> @asterite - What's an example of terseness?
<FromGitter>
<marksiemers> It can't ever be worse than Go
<RX14>
it can be
<RX14>
apl
<FromGitter>
<asterite> oh, Go is the opposite
<FromGitter>
<asterite> I mean, in Ruby/Crystal sometimes there's too many things going on in just one line or two
<FromGitter>
<eliasjpr> After using Crystal for a while you soon realize that it diverts from ruby mind set, and you see more of a need to right things once and one way
<FromGitter>
<asterite> and all put together like someone puked that code
<FromGitter>
<asterite> (that's at least what comes to my mind)
<FromGitter>
<Fryguy> one-line-all-the-things ;)
<RX14>
@asterite there is a sense of that
<RX14>
with go youc an't really write eldritch horrors
<RX14>
even if you want to
<FromGitter>
<asterite> i'll try to find an example, not sure I'll quickly find one
<RX14>
with crystal you definitely can
<RX14>
crystal gives a lot more trust in the programmer than go
<RX14>
but less than ruby
<FromGitter>
<eliasjpr> For instance you can see the std lib that crystal does not have 20 methods for the same thing it cuts that nonsense
<RX14>
I like crystal's balance
<FromGitter>
<marksiemers> > not sure I'll quickly find one ⏎ ⏎ It sounds like it is a sometimes problem, not a most-of-the-time problem
<FromGitter>
<eliasjpr> Ruby has like 10 method aliases per implementation
<FromGitter>
<asterite> (I wrote it so no one can be offended with that puke comment :-P)
<FromGitter>
<asterite> maybe it could benefit with some more newlines... I don't know
<RX14>
yeah
<RX14>
that was my first reaction
<RX14>
"whitespace"!
<RX14>
size calc is one "block"
<FromGitter>
<asterite> or comments, probably
<FromGitter>
<codenoid> i came from php, and i hate it because php doesnt tell me about Int, String, Float type
<RX14>
so i'd put whitespace after that and before the array creation
<RX14>
then i'd look at the loop body
<FromGitter>
<marksiemers> > <RX14> I like crystal's balance ⏎ ⏎ Agreed, its like the tradeoff between the ease (syntactically) of high-level languages, and the speed of lower-level languages has finally been solved.
<RX14>
(using end. is ugly)
<FromGitter>
<eliasjpr> PHP, lol I was trolling trying to get people to use amber and I got the nastiest response
<RX14>
and then i'd think `find[1]`, don't we have a .first ?
<FromGitter>
<sdogruyol> for me, Crystal is best of both worlds. I've done Java before falling into love with Ruby
<RX14>
and then whitespace between pattern = and copy
<RX14>
and then it's kinda neat
<FromGitter>
<eliasjpr> Worst than ⏎ ⏎ > **<RX14>** no backlash? even I thought it was a stupid article
<RX14>
I wish the article had gone through a PR
<RX14>
that's what I think
<RX14>
I had no idea about that article until it was published
<FromGitter>
<asterite> I liked the article
<FromGitter>
<asterite> One thing about type restrictions is that the article doesn't say that if you don't put restrictions and pass an incorrect type, you still get a compile error
<FromGitter>
<asterite> by reading it without previous knowledge, it looks like you have to type the arguments in order to get that benefit
<Vexatos>
an article?
* Vexatos
scrolls up
<RX14>
My #1 complaint is overstating the ease of use to newcomers
<FromGitter>
<asterite> and that's something that Rubyists would immediately say "no, forget it" when seeing it
<FromGitter>
<sdogruyol> it actually went through a review process @RX14, I think @marksiemers forgot to add you on the google docs (he probably didn't know your email)
<RX14>
no mention on the core team slack though
<FromGitter>
<marksiemers> @asterite - I think that linked code could be refactored with some helpfully names methods, but your point stands, it is possible to write some terse code.
<FromGitter>
<sdogruyol> yeah, that's our lack of communication lol
<RX14>
Perhaps next time just make a sharing link and paste it in slack
<FromGitter>
<sdogruyol> I actually didn't know it's posted on the blog..I saw the link on reddit
<FromGitter>
<sdogruyol> a start is always better than nothing. Next time, we'll be more coordinated for sure
<FromGitter>
<marksiemers> @RX14 - I emailed crystal@manas.tech and communicated with Brian and Nico via email. They asked for a Google doc for the review process. ⏎ I included them, Serdar, and Paul C Smith (since Kemal and Lucky were mentioned)
<FromGitter>
<marksiemers> and members of the Amber team.
<FromGitter>
<marksiemers> @asterite and @RX14 - These are points that could definitely go in the Disqus comments and/or the article can get an edit and update noting the changes.
<FromGitter>
<marksiemers> I'm guessing the guys at Manas would be willing to do that.
<FromGitter>
<marksiemers> I certainly am
<FromGitter>
<marksiemers> With any luck, we'll have 3 more posts this month - about 3 of the web frameworks.
<FromGitter>
<marksiemers> Next month, hopefully a couple articles from @bararchy and/or @ArtLinkov
<FromGitter>
<ArtLinkov> No worries, @marksiemers My fingers are itching to write them up ;)
<FromGitter>
<drujensen> @ArtLinkov hopefully on CNN using SHAInet. ;-)
<FromGitter>
<ArtLinkov> @drujensen Yeah, we're getting there... I really wanna do a benchmark test comparing a CNN implemented in Crystal vs. the other languages. Hopefully we can make it faster, providing Crystal with a good good in the door for ML
<FromGitter>
<fsdevblog> I guess you are tired from questions with link to ruby... but i'm looking for something like `instance_variable_get` in Ruby.
<FromGitter>
<straight-shoota> Usually you shouldn't have to test private ivars. Though I know it can be useful sometime... my PR for time zone support contains some uses of this.
<FromGitter>
<straight-shoota> Basically, you can define a public method on the class only for the spec through reopening:
<FromGitter>
<straight-shoota> `Foo#__bar` will only be defined for spec purpose but not in the library itself. The `__` prefix is just my personal preference to make sure it doesn't overwrite any existing instance methods.
<lvmbdv>
yeah, just weird that you dont recommend what the docs show as an example
alex`` has joined #crystal-lang
<oprypin>
lvmbdv, you'll be fine either way but implementation-wise class is just an unneeded additional pointer
<oprypin>
with garbage collection and whatnot
<FromGitter>
<fsdevblog> @oprypin are you russian?
<lvmbdv>
alright, thanks
<oprypin>
of course, this wrapper's methods will all return a normal string
<oprypin>
fsdevblog, well that's random
<FromGitter>
<fsdevblog> @oprypin I thought that maybe you can tell me in Russian in which situations to use the `struct` and in which `class`. it's still hard for me to understand what's happening here)
<FromGitter>
<fsdevblog> A couple of hours ago, there was a discussion here that the rubist could easily understand the crystal. So that's it. this is not true )
<oprypin>
no, Rubyists have a harder time understanding Crystal
<oprypin>
but have some advantages in remembering the standard library
<robacarp>
hm, why do you say that?
<FromGitter>
<fsdevblog> who? what say?
<oprypin>
robacarp, i say that because i keep seeing people who try write Crystal without reading the docs. sounds ridiculous, right?
<robacarp>
well, reading the docs should be the first place to go, but what does that have to do with rubist/pythonista/etc
<FromGitter>
<fsdevblog> You talking about my question about struct and class?
<oprypin>
robacarp, some rubyists think they don't need docs, or at least don't need all of it
<robacarp>
@fsdevblog, sorry, no, getting more information about coming from ruby
<robacarp>
I came (most recently) from a ruby background and didn't have many issues
<robacarp>
compiler type inference and safety changes the way I write code a lot, and that's probably a change lots of rubists aren't ready to make
<oprypin>
fsdevblog, particularly the bottom of the post
<oprypin>
which is a bunch of messages i wrote in IRC then copied there "for later" :|
<oprypin>
i should finish it one day, it's (supposed to be) a very nice post
<FromGitter>
<fsdevblog> @oprypin , thank you for good article. but if something like this was in the documentation - I would not ask you. Sorry to bother you.
<FromGitter>
<imonmyown> guys is there a way to initialize a `Deque` from a `Slice` without extra allocation? `.new` with a `&block`?
<oprypin>
imonmyown, there is no way in standard library to do that without copying. there are some ways to do it with hacks though. not recommended
<oprypin>
it's quite a concise reference, they don't explain every concept in computing
<FromGitter>
<imonmyown> @oprypin I see, thanks. What hacks are implied if performance was paramount (not that I need it, just interested)?
<oprypin>
imonmyown, reopen Deque and add your own constructor, probably
<FromGitter>
<fsdevblog> it's information maybe useful for peoples, who knows for example what is pointers and etc... Not for people, who came from php, ruby and etc.