<dreamer_>
I havent touched some project in a while and now that I'm back to it a few things broke with the last update
<dreamer_>
I fixed the JSON ones but I don't understand this one in particular
<dreamer_>
"instance variable '@wp_type' of Labels::Weapon must be Array(Labels::Label), not Array(Labels::Abdomen | Labels::Alfe | Labels::Ambidextry | Labels::Amulet etc....."
<dreamer_>
was something changed in the way you had to declare array of possibles subclasses ?
<dreamer_>
sorry for broken english
<dreamer_>
rly tired
<FromGitter>
<bararchy> @girng long time :) how are you?
<dreamer_>
..they're not saying how to collapse manually
<dreamer_>
I'' just include a type that is not on the same level to force the collapse
<dreamer_>
but something seems wrong
<dreamer_>
as in it feels dirty
<dreamer_>
maybe I'm not supposed to use subtypes that way
<FromGitter>
<j8r> I wonder β is there a plan to merge the YAML/JSON Anys to share a common implementation?
<dreamer_>
thanks a lot fgimian and gdotdesign
<dreamer_>
I think I'll post an issue and see the feedback
<dreamer_>
yeah I cant actually include a type that is not on the same level
jfo_test has joined #crystal-lang
<dreamer_>
doesnt work
<dreamer_>
;-;
<FromGitter>
<n00ax> So according to platform support, crystal isn't supposed to support aarch64 musl, but after just trying to produce a static executable linked against musl, I don't see any problems... (although I don't know enough about internals to make any claim)
<FromGitter>
<n00ax> @j8r Oooh thanks, did not see that issue being fixed, was still under the assumption that it failed (the last time I tried was early 2017), thanks..
fifr has joined #crystal-lang
<FromGitter>
<j8r> there is also crystal 0.25.0 on alpine:edge for x86-64 and aarch64
<FromGitter>
<ok2094> Are there singletons in crystal?
<FromGitter>
<Grabli66> Of course, if you do not catch the exception
Raimondii has joined #crystal-lang
<jokke>
is there somekind of utility method to proxy a socket to another?
<jokke>
now i'm spawning an IO.copy for both directions
dreamer_ has quit [Quit: Page closed]
Raimondi has quit [Ping timeout: 264 seconds]
Raimondii is now known as Raimondi
dreamer_ has joined #crystal-lang
<RX14>
dreamer_, there's a better way, check the issue :)
<dreamer_>
! thx
<FromGitter>
<fgimian> is it possible to do sub-commands with OptionParser guys? I can't see a way
<FromGitter>
<girng> @bararchy great, extremely happy right now doing inventory update on server
<FromGitter>
<bararchy> When will your game be out?
<RX14>
@fgimian you have to do it manually
<FromGitter>
<girng> inventory tetris, needs to check for collision based upon slot_size (2x2) or w/e, basically an array matrix. i already got it working in gdscript. and the cool thing is, since i've been messing with crystal for a while, i can just convert the gdscript to crystal. LOVE IT
<FromGitter>
<girng> @bararchy iuno soon, need to finish monster ai stuff on server and i'll be good to go
<FromGitter>
<girng> man, i love how i can just make a new file, and do class MasterServer, then BOOM all my methods can be called from main script
<FromGitter>
<girng> helps with organization sooo much, and so clean
<FromGitter>
<vladfaust> Why is @asterite always whining about how bad macros are and encourages to not using them? I wouldn't do Crystal if it hasn't got macros at all, this is its top feature imo. Beautiful DSLs are only possible with macros. Less code is possible with macros. Conditional buillding is possible with macros as well. Is that an artist syndrome when they think their art sucks just because they got bored of it
<FromGitter>
... themselves? The truth is it doesn't suck at all :/
<FromGitter>
<vladfaust> You guys already created a language with powerful meta-programming, many love it because of it. There is no way back, you should only improve macros, not discourage from using them. Better docs, better functionality.
<FromGitter>
<vladfaust> Macros allows to write more human-like code, and that's what the language of the future is about. That why I love Ruby and came to Crystal - for linguistics near to natural English
livcd has joined #crystal-lang
<FromGitter>
<bararchy> The best tip I can give you is "If it works for you and makes you happy do it"
<FromGitter>
<hmans> @vladfaust Is far as I understand asterite, he's not been saying that macros are bad, but using them too early is, and I tend to agree
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter>
<hmans> As powerful as macros are, they're a great way of making your code incredibly harder to maintain and reason about, while not always giving you the sort of benefit you were expecting.
<FromGitter>
<hmans> I'm sort of reminded of the discussion around Ruby metaprogramming from a few years (a decade?) ago, where everybody was define_method'ing and method_missing'ing all over the place, and people eventually learned that 9 our of 10 DSLs didn't even require hackery like that.
<FromGitter>
<vladfaust> @bcardiff nice point! However, in my field, web-programming, issues never occure because of macros themselves, they're only improvements, and these super-low-level issues in macro implementation only Ary knows about don't cost discouraging from using macros at all
<FromGitter>
<vladfaust> @hmans did this meta stuff improved readability and end-code understanding?
<FromGitter>
<hmans> @hmans It did for the consumer, while making the implementation hard to impossible to reason about. (An early version of ActiveRecord would build huge strings containing method declarations and send them through `eval`. Fun times.) The important point here is that sanity eventually returned, while still allowing for nice to look at DSLs for the consumer.
<FromGitter>
<bcardiff> On one hand, sine macros are doing great for you, you like them a lot. If you have to develop them, well ...., it's harded to like them in the same way. On the other hand, the balance between expresiveness, boilerplate is an opinion that can shift along the time. Ary might be one one side of the balance. β β But as @bararchy said, it works for you, be happy and use them. β From the experience and more
<FromGitter>
<hmans> When it comes to Crystal, I (naively... I'm still new to the party, right) believe that the core of most DSLs can be built without macros, with some macro logic sprinkled in for convenience (like generating some boilerplate methods like I do here (https://github.com/hmans/crankypants/blob/master/crappy/src/crappy.cr#L142-L146))
<FromGitter>
<hmans> And we love you for it
<FromGitter>
<bcardiff> Do you want to know the dust in it's corner XD ?
<crystal-gh>
[crystal] icyleaf opened pull request #6258: fix time parse doc (master...fix-time-parse-doc) https://git.io/f49uS
<FromGitter>
<bararchy> Today in `Crystal Unmasked`, we talk with Brian, about the diry little secrets
<FromGitter>
<vladfaust> Any plans on macro recursion, BTW? It would open so much new possibilites
<FromGitter>
<bcardiff> But seriously, In the snippet β β ```foo do β bar β end``` β β you don't know without checking the source code of foo if bar is to be looked up in an object yielded by foo or in the same receiver as foo. That puts a limite for incremental/modular compilation, since know for analysing that single snippet you need to source of foo. [https://gitter.im/crys
<FromGitter>
<vladfaust> Gonna have funny weekend rewriting some shards to utilize recursion :D
<crystal-gh>
[crystal] docelic opened pull request #6259: Docs: Update man page with new options (#5554) (master...master) https://git.io/f49gp
<FromGitter>
<girng> some reason i keep typing each_width_index π π
<FromGitter>
<Grabli66> Will it be insolence if I ask about the progress of the Windows port? I am statring hate to use Virtual Box with linux. :)
rohitpaulk has quit [Ping timeout: 268 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter>
<j8r> Just use WSL
<FromGitter>
<Grabli66> Windows 7. And i can't remove it. :). Ok. I'll wait.
<RX14>
once I catch up with my backlog of github issues i'll be working on it again
rohitpaulk has quit [Ping timeout: 256 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter>
<j8r> @Grabli66 try to install and use https://git-scm.com/ , there is a cygwin under the ground (Or sort of emulation)
<RX14>
crystal wont work on cygwin I think
<FromGitter>
<Daniel-Worrall> Could you also provide an up to date wiki on ways to help with the Windows port?
<RX14>
is it not up to date?
<FromGitter>
<Grabli66> @j8r It's just git for windows. No?
<FromGitter>
<Daniel-Worrall> There's a lib missing that I needed to build the hello world and once I have everything I'm unsure what I can look into to improve functionality
<RX14>
what's the missing lib?
<FromGitter>
<Daniel-Worrall> I'm on mobile. Just looking it up now
<RX14>
i presume you're using my windows branch?
<FromGitter>
<Daniel-Worrall> User32 I think
<RX14>
weird
<FromGitter>
<j8r> Git for windows (git-scm) uses MinGW
<FromGitter>
<Daniel-Worrall> Yeah. I needed user32.lib and it's not listed on the wiki
<RX14>
oh
<RX14>
yeah
<RX14>
I really need to script it all up
<RX14>
make a single script that bootstraps all the libraries and everything
<FromGitter>
<Daniel-Worrall> I got the bash script working with Windows ask
<FromGitter>
<Daniel-Worrall> But yeah. Once I have your branch, I'm unsure what I need to be looking at in terms of specs to check and how to run them
<RX14>
well there's a nice big file
<RX14>
src/windows_spec.cr
<RX14>
which has all the spec files in, and the ones that dont work are commented out
<FromGitter>
<Daniel-Worrall> For me that gives different results to what's on the repo
<RX14>
how so?
<FromGitter>
<Daniel-Worrall> The generate Windows spec file gave different results and the current spec file had failing specs
<RX14>
:(
<RX14>
would be useful to get a dump of those errors
<FromGitter>
<fgimian> Another way to work on Windows is to setup Sambda on your VM and mount the disk as a drive, then use PuTTY or similar to SSH into the Terminal
jfo_test has quit [Ping timeout: 245 seconds]
<FromGitter>
<fgimian> There's also Dokan and WinSSHFS which can mount SSH as a drive too, which is also great and free
<FromGitter>
<fgimian> Git Bash won't do much for ya in this scenario
<FromGitter>
<fgimian> You do need Crystal to compile Crystal ... not sure how this is done on Windows, maybe RX14 can advise π
<RX14>
you dont
<RX14>
you always cross-compile
<RX14>
thats what the script is for
<faustinoaq>
RX14 would be possible to compile crystal from LLVM-IR?
<RX14>
automatically cross-compiling and scping the result to windows
<RX14>
what
<RX14>
yes it's possible because the compiler generates llvm ir but what does that get you?
<FromGitter>
<Grabli66> @kingsleyh "...we have a plugin style architecture for building dApps in the core language we use which is Crystal". Do you use some kind of IPC for these plugins? Sockets? Pipes? Something else?
<FromGitter>
<Grabli66> How do you write plugins in crystal lang? :)
<FromGitter>
<bararchy> @kingsleyh congratz
<faustinoaq>
@kingsleyh Wow,awesome! :)
<FromGitter>
<kingsleyh> @Grabli66 not really - when you make a transaction on the blockchain you include an action - and you register a dApp and connect it to the main node (peer-to-peer using Chord algo) - and you can intercept any transactions that include the target action - this way no matter which node the transaction is sent to - it will eventually be picked up and processed by your dApp
<FromGitter>
<kingsleyh> but I called it a plugin style arch - because thats the closest thing I could think of to describe it
<FromGitter>
<Grabli66> When i thing about plugins i imagine DLL-s :)
<FromGitter>
<kingsleyh> yeah it's a pretty generic word!
<FromGitter>
<Grabli66> I want a possibility to create dynamic libraries in crystal. IPC with marshaling is slow. But i think it's impossible π
dreamer_ has quit [Quit: Page closed]
<FromGitter>
<Grabli66> Great thanks to them π
<FromGitter>
<Grabli66> I am trying to find other compiled language with good syntax, performance. And i can't. Have to work with crystal. π
rohitpaulk has quit [Ping timeout: 264 seconds]
<RX14>
IPC is plenty fast enough honestly
<FromGitter>
<Grabli66> Let me disagree. It's slow, but safer, i think.
<RX14>
its slow
<RX14>
but is it really too slow?
<RX14>
for most applications, no
<RX14>
for most applications they can easilly get away with RPC over http ffs
<FromGitter>
<epergo> oh lol I missunderstood his comment, sorry guys π
rohitpaulk has joined #crystal-lang
jfo_test has joined #crystal-lang
<FromGitter>
<bararchy> RX14: The point is something like this: https://play.crystal-lang.org/#/r/4dzz β We want to add to SHAInet a way to extract the neurons whigts and biases into a matrix representation, we want to have bot our Array(Array(Neurons)) and also the Array(Array(Pointer(Int32))) that represents the actual values, this way we can enjoy both object-orianted neural network which has neuron level control, but also to
<FromGitter>
... work on the whole matrix it self.
<FromGitter>
<bararchy> So if I try to re-phrase, we want a shourtcut into the primitive (Float64\Int32) values inside the classes the we can change externally
<RX14>
i don't get why
faustinoaq has quit [Quit: IRC client terminated!]
rohitpaulk has quit [Ping timeout: 245 seconds]
<FromGitter>
<bararchy> RX14 I'll try to explain, working on a Matrix is much faster and make us do 3-4 less method calls, and we suspect it will improve the speed of running quite drasticly
<RX14>
have you benchmarked it?
<RX14>
I wouldn't be surprised if LLVM just optimized it anyway#
<RX14>
after all, to get from a pointer to an object to a pointer to an ivar in an object it's just adding a constant number
<RX14>
and pointer math is free
<FromGitter>
<ArtLinkov> It's a matter of how we constructed the object logic within SHAInet
<RX14>
so the Int32s aren't just ivars in Neuron?
<RX14>
you loose a whole level of pointer indirection by switching from Array to Slice too
<RX14>
which sounds like something you'd definitely want to look ayt
<RX14>
since Array is a class and Slice is just a struct
<FromGitter>
<bararchy> hmmm
<RX14>
what you gain for that added level of pointer redirection is the ability to dynamically resize
<RX14>
so for code sections where you know it's fixed size
<RX14>
you definitely want to deal with slices
<FromGitter>
<bararchy> When you resize all hell breaks loose
<RX14>
yes
<RX14>
you really want to copy to slices
<RX14>
instead of just confert the array pointers to slices
<RX14>
but that's very possibly not possible
<RX14>
also if you're working with matrixes, wouldn't you be better off with a custom Matrix which keeps all the memory contigious
<RX14>
then the prefetcher would have half a clue what the fuck's going on
<RX14>
Array(Array()) is genuinely terrible for performance
<FromGitter>
<bararchy> That's exactly what @ArtLinkov is doing now (custom matrix )
<RX14>
nice!
<RX14>
sounds like the GC might complain at you for that though :)
<RX14>
very large allocation presumably
<RX14>
you could well be better off manually using mmap for matrixes, assuming they're very long-lived, mutable, and infrequent
<FromGitter>
<yxhuvud> " instead of Layer.neurons[0].synapses[0].wight = 1" <- this is a sign you need to refactor your memory layout
snsei has joined #crystal-lang
jfo_test has quit [Ping timeout: 245 seconds]
snsei has quit [Remote host closed the connection]
snsei_ has joined #crystal-lang
snsei_ has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<crystal-gh>
[crystal] bcardiff opened pull request #6260: Update to latest distribution-scripts (master...ci/update-dist) https://git.io/f49Fi
<FromGitter>
<ok2094> What does something between pipes mean? e.g. `|p|`
<RX14>
it's an argument to a block
<RX14>
blocks take arguments just like methods
<RX14>
and you have to give them a name, just like methods
jfo_test has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter>
<ok2094> Thanks
snsei has joined #crystal-lang
<FromGitter>
<j8r> often they are special methods
snsei has quit [Remote host closed the connection]
<FromGitter>
<bcardiff> `!` are used for alternate but related behavior. In collections that is usually in-place operations instead of returning a copy.
<RX14>
yeah but that doesnt have much to do with blkock args
<RX14>
block*
<FromGitter>
<ok2094> Ah, that wasn't related to my block question.
<RX14>
oh
<RX14>
ffs
<RX14>
gitter bridge is loosing messages
<RX14>
ugh
<RX14>
oprypin,
<RX14>
I wish we'd just move off gitter
<RX14>
unfortunately there aren't many good alternatives
<RX14>
gitter's API seems to be extremely unstable
<FromGitter>
<j8r> nice they have created this :+1
<FromGitter>
<RX14> cool
<FromGitter>
<RX14> and the IRC bridge looks better to me
<RX14>
test
<FromGitter>
<RX14> no
<crystal-gh>
[crystal] RX14 opened pull request #6261: Use Exception#inspect_with_backtrace where sensible (master...feature/use-inspect_with_backtrace) https://git.io/f4HUW
<FromGitter>
<RX14> oh yet another reason not to use the gitter IRC bridge
akaiiro has quit [Remote host closed the connection]
<FromGitter>
<vladfaust> *cough* slack *cough*
pwned has joined #crystal-lang
<FromGitter>
<adamgotterer_twitter> If I run a process in the background using Process.new, how can I access it's output? I've tried passing output: IO::Memory and Redirect::Pipe with no luck.
snsei has joined #crystal-lang
akaiiro has joined #crystal-lang
<FromGitter>
<j8r> Closed source paid chat aren't the solution
<FromGitter>
<RX14> slack is the wrong tool for the job for open source
snsei has quit [Ping timeout: 265 seconds]
<FromGitter>
<ok2094> let's just use sms and mms for code examples /s
<robacarp>
this is a weird error I don't know how to dig into: must be Proc(Array(OrmTestGranite::User)), not Proc(Array(OrmTestGranite::User))
<FromGitter>
<Blacksmoke16> :thinking:
<RX14>
robacarp, can you show code?
wontruefree has joined #crystal-lang
<pippin>
a
<FromGitter>
<wontruefree> rx14 +1 to slack comments
<FromGitter>
<RX14> because we want to support open source software
<FromGitter>
<vladfaust> Okay, that's rude
rohitpaulk has quit [Ping timeout: 240 seconds]
<robacarp>
@blacksmoke16 whats weird about this is it seems like it's a collision with lucky somehow
<FromGitter>
<paulcsmith> I'd love to switch away from Gitter @vladfaust. I think the UI is pretty bad and it's super slow. I only use Gitter for Lucky because Crystal uses it. I'd love it if we used Slack or Discord
<FromGitter>
<vladfaust> @paulcsmith hope your opinion is valued more
<FromGitter>
<RX14> so am I
<robacarp>
I'd second ditching gitter, but it does have the perk that it provides a mobile app. I am on so _many_ slack teams, and the slack app does a bad job of scaling memory usage. I think they boot an entire electron app for each team, but that's just a guess. That said, I don't really want another chat client in my life.
<FromGitter>
<RX14> i think the only thing i'd do to replace gitter is host a custom modern web IRC client on chat.crystal-lang.org
<FromGitter>
<paulcsmith> Why is that? Without reasons it is hard to figure out why you're against it or what a better alternative wouldbe
<FromGitter>
<vladfaust> Any principle bounds development in some way
<FromGitter>
<RX14> chat services do have a very high moving cost
akaiiro has quit [Remote host closed the connection]
<FromGitter>
<benharri> self-hosted client that is a bouncer and supports logging in from multiple locations
<FromGitter>
<benharri> > In other words, IRC is here, and IRC is backed.
<wontruefree>
I support the more to irc
<wontruefree>
we would loose features some people really like such as media support and code block support
<RX14>
code blocks should go to a centralised paste service as a URL
<wontruefree>
I think web irc is important if someone just found crystal and does not have an irc client setup but RX14 covered that
<RX14>
also wontruefree you're missing half the conversation
<RX14>
dunno if you saw earlier but the bridgebot is broken
<RX14>
it's only relaying half the messages
<wontruefree>
Oh I thought that was fixed
<wontruefree>
I saw it earlier
<RX14>
nope
<RX14>
its still going
benharri has joined #crystal-lang
<RX14>
100% of irc is making it to gitter but not the other way around
<wontruefree>
:(
<RX14>
waiting for oprypin to investigate
<wontruefree>
is it self hosted ?
<RX14>
yes
<RX14>
oprypin hosts the bridgebot
<crystal-gh>
[crystal] sdogruyol pushed 1 new commit to master: https://git.io/f4HEU
<crystal-gh>
crystal/master fc01468 Chris Hobbs: Use Exception#inspect_with_backtrace where sensible (#6261)
<FromGitter>
<sdzyba> +1 for slack/discord or whatever which doesn't laggy as much as gitter and has good channels support (telegram sucks at this too, unfortunately)
fryguy9 has joined #crystal-lang
<FromGitter>
<shimbaco> Iβd like to create a channel for Japanese users on Slack/Discord. π
<wontruefree>
what is discords connection with open source?
<benharri>
wontruefree: they've open sourced a couple utilities. none other that i know of
<RX14>
yeah
<RX14>
discord isn't really open source
<RX14>
well no
<RX14>
it's completely closed
<RX14>
and their business model is fairly non-existant too
<wontruefree>
ok that does not sound sustainable
<benharri>
they've recently gotten an influx of vc cash but they didn't really have an income model
<RX14>
their model seems to be to get bought
<benharri>
^^
<wontruefree>
that seems crazy
<benharri>
i use it for some gaming chats but that's it
<lvmbdv>
-1 for slack/discord
<lvmbdv>
slack is IRC for dummies and discord sells your data
<lvmbdv>
just use IRC if you want consistence
<wontruefree>
it does seem like slack is fancy irc client
<RX14>
this discussion is pretty much going around in circles
<lvmbdv>
i can shit on proprietary platforms all day, it's fun
<crystal-gh>
[crystal] RX14 closed pull request #6097: Added example of nesting mappings to YAML builder (master...add_yaml_doc) https://git.io/vpQEo
<benharri>
^^ lvmbdv
<wontruefree>
ok very true
<wontruefree>
has anyone ever mess around with ctags?
<wontruefree>
i found a 3 year old issue about ctags and some gists of that time but it looks like nothing was merged in for ctags
<RX14>
nah I havent seen anyone work on it
<wontruefree>
is that normally in a compiler or is that in another project
<wontruefree>
I thought with ruby and such you use the ctag executable
<FromGitter>
<hugoabonizio> Aaron Patterson (@tenderlove) says it's not possible to pass a lambda as a parameter to another lambda in crystal, thus it's not possible to do lambda calculus on it
<wontruefree>
that is awesome. I have not seen that yet
cyberarm has quit [Ping timeout: 264 seconds]
<FromGitter>
<ok2094> Does anyone know how to handle file uploads with Amber?
<faustinoaq>
@ok2094 Hi, we encourage to have all "web framework" related things in their official rooms/channels to keep only crystal language things here :)
<FromGitter>
<ok2094> Alright, sorry :)
<faustinoaq>
Is like a Ruby channel/room full of RoR stuff xD
cyberarm has joined #crystal-lang
faustinoaq has quit [Quit: IRC client terminated!]
lvmbdv has quit [Quit: Leaving.]
<FromGitter>
<girng> @faustinoaq long time no see my friend
<wontruefree>
I dont get why it does not return an Int32
<crystal-gh>
[crystal] asterite opened pull request #6266: Add dup and clone for JSON::Any and YAML::Any (master...feature/6220-json-any-dup) https://git.io/f4Qe0
<FromGitter>
<n00ax> Updated my previous crystal cross-compile wrapper to use Docker multiarch Alpine images enabling static cross-compilation to aarch64 with MUSL (also made the tool architecture agnostic)
<crystal-gh>
[crystal] asterite opened pull request #6267: Require "big" if requiring any "big" file (master...bug/6257-big-int-require) https://git.io/f4QeX
wontruefree has quit [Quit: bye]
rocx has joined #crystal-lang
<FromGitter>
<ok2094> How can I loop through a directory to show all files?
<FromGitter>
<ok2094> Thanks, didn't find this. Was trying to figure something out with file lol