<FromGitter>
<watzon> I just want to validate emoji 😢
<FromGitter>
<watzon> Lol
_whitelogger has joined #crystal-lang
renich has quit [Ping timeout: 246 seconds]
early has quit [Quit: Leaving]
renich has joined #crystal-lang
early has joined #crystal-lang
renich has quit [Remote host closed the connection]
renich has joined #crystal-lang
sorcus has quit [Ping timeout: 260 seconds]
sorcus has joined #crystal-lang
renich has quit [Ping timeout: 256 seconds]
<oprypin>
@watzon: that range of codepoints can't appear in a string
<FromGitter>
<watzon> Is there a less strict version of `URI.encode`? It doesn't just replace reserved characters, but also seems to replace anything not in the ascii range.
<FromGitter>
<watzon> For instance cyrillic becomes a garbled mess
<FromGitter>
<watzon> Seems like `encode_www_form` does the same, despite the docs saying "Reserved characters are escaped, unreserved characters are not."
<FromGitter>
<mattrberry> Ughhhh static arrays still don't really work when they're long, even using @j8r's workaround :/ After 5+ minutes of compilation (not even for release): ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5ee9ae7cee693d6eb3cc2780]
<FromGitter>
<naqvis> i'm still not convinced on why you need to have so big array on stack, but if you still insist on having whole thing on stack, then try to increase the stack size limit and see if that does the trick
<FromGitter>
<mattrberry> When I use arrays or slices, I get weird data corruption. I can't explain why. All I can say is that it consistently *happens* with arrays and slices, and it consistently *doesn't happen* with static arrays
<FromGitter>
<didactic-drunk> Large stacks with fibers doesn't work very well. One person reported crashes after a certain size that's probably platform specific.
<FromGitter>
<mattrberry> I wish I could tell you why
<FromGitter>
<naqvis> segfaults with slices, have you tried running without GC, to rule out the GC issues?
<FromGitter>
<naqvis> since you are doing the FFI, so it might be GC getting into play prior to external lib get access to data, thus segfaulting
<FromGitter>
<mattrberry> What's the flag to disable gc again?
<oprypin>
@watzon: cyrillic garble is also intentional and correct behavior
<FromGitter>
<mattrberry> Still segfaulting or just getting garbage
<FromGitter>
<mattrberry> Even without gc
<FromGitter>
<naqvis> so its not GC issue
<FromGitter>
<naqvis> but good, that we rule that out
<FromGitter>
<naqvis> can you try to create a short code to reproduce the segfault?
gangstacat has joined #crystal-lang
dom96 has quit [Ping timeout: 256 seconds]
<FromGitter>
<mattrberry> It doesn't always segfault. Sometimes it just reads obviously garbage memory instead of the arrays/slices I'm giving it. It depends entirely on the structure of the class
<FromGitter>
<mattrberry> I can try to walk you through an example if you like
<FromGitter>
<naqvis> > ... Sometimes it just reads obviously garbage memory instead of the arrays/slices I'm giving it. ... ⏎ do you mean external library?
dom96 has joined #crystal-lang
<FromGitter>
<mattrberry> Yeah
<FromGitter>
<mattrberry> Can I help walk you through the bug? If you clone the repo, I can show you some simple steps to just make everything go wonky
<FromGitter>
<mattrberry> It's a little more laggy with audio, but that's still a work in progress :p
<FromGitter>
<mattrberry> There's a download button on the page I linked
<FromGitter>
<naqvis> gotcha
<FromGitter>
<mattrberry> It downloads a zip, and the .gb file is in the zip
<FromGitter>
<mattrberry> And once you've built it, you should be able to just run `bin/cryboy /path/to/oh.gb`
<FromGitter>
<mattrberry> And hopefully you'll see that audio seems to be working fine with static arrays, except for the occasional small stutter that I'm working out
<FromGitter>
<mattrberry> I'm also explaining this to some people over DMs rather than in this channel at the same time, so I'll just put everything I know here
<FromGitter>
<mattrberry> ^ Hopefully if you've just cloned the repo and built it, everything should be working fine with static arrays
<FromGitter>
<ilourt> Hi, I want to create an ArrayLiteral in a macro but I have this error 'Error: undefined constant ArrayLiteral'. Do you know how I can instantiate an ArrayLiteral?
<jhass>
?xy
<DeBot>
it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
<FromGitter>
<ilourt> ?
<FromGitter>
<ilourt> Is it for me @jhass
<jhass>
yes :)
<FromGitter>
<ilourt> I dont understand your point. I just ask how to create an ArrayLiteral
<jhass>
why do you need an ArrayLiteral?
<FromGitter>
<Nicolab> lol
<FromGitter>
<Nicolab> ... sorry Irwin I don't have the solution
<FromGitter>
<ilourt> Because I need to instantiate an array in a macro. And Array is not available in a macro, only ArrayLiteral is available
<jhass>
Why do you need to instantiate an array in a macro?
<FromGitter>
<bararchy> @ilourt the point is, explain what you're trying to achieve, so that help for you issue might take context into account, also, a code snippt or two won't hurt :)
<FromGitter>
<ilourt> Because I want to avoid to do several times for loop on instance vars. I want to store the types in one array and the attribute name in another array
<jhass>
What are you doing that you need to loop over instancevars?
<FromGitter>
<ilourt> Perfect @jhass it exactly answer my question
<FromGitter>
<ilourt> thank you
<jhass>
is it the best solution to your actual problem? We'll never know :)
<FromGitter>
<ilourt> Just to know is it possible to create it with writing `{% names = ArrayLitteral(String).new %}` or something equivalent. ⏎ Just like you can create an array with both ways in normal code: https://play.crystal-lang.org/#/r/9a8t
<jhass>
no :)
<jhass>
You generally cannot .new up AST nodes in macro land
<FromGitter>
<ilourt> Ok thanks for your answer. Now I know it ;)
<jhass>
and also generally if you reach that level of complexity in macro land where you want to, that's for me at least a red flag where I might reconsider my design :)
<FromGitter>
<ilourt> If you look the example posted above, I don't think it is something to complicated nor fancy
<jhass>
the example is minimized and constructed to the solution you want :)
<jhass>
it doesn't feel representatitve of the underlying problem
<FromGitter>
<ilourt> I understand your point of view. I have already thought a lot about the design. What I missed was how to do it (creating an arrayLiteral). ⏎ Just to answer your last message the example I posted is quite representative of what I tried to do.
<FromGitter>
<ilourt> My original question was about how to do it in crystal and not about the design
<FromGitter>
<ilourt> ;)
<sorcus>
Hi :-)
<mps>
jhass: I got crystal 0.35.0 working on alpine aarch64 with your patches, need some fixes and tweaks, but now I can compile some simple programs and they works
<raz>
well, initial ones might be low-end, but prob won't stay that way. apple is quite ahead of intel in the cpu game nowadays
<FromGitter>
<ucodelukas> i love crystal, thank you all
postmodern has quit [Quit: Leaving]
<mps>
raz: I'm using arm boxes as workstations for about 5 years, chromebooks with native installed linux, so apple is at least 5 years behind me :)
<raz>
apple makes them fast tho
<raz>
that A12Z is apparently right up there with intel i9 and that's without cooling
<raz>
(prob not in all types of workloads, but those little benchmark bars look pretty impressive)
<mps>
but, yes, I agree with apple, intel is bad. that was reason I switched to arm
<raz>
i don't care much either way, but if arm gives me a fanless laptop with 2 days of bat life that's as fast as my current one, i'll take it
<raz>
(only if it runs crystal tho :p)
<mps>
if I keep it in suspend-to-ram battery lasts more than a week :)
<raz>
i bet you can stretch that even longer if you turn it off completely :p
<mps>
:)
flaviodesousa has joined #crystal-lang
flaviodesousa has quit [Remote host closed the connection]
<mps>
raz: I hope we will have crystal again in alpine linux, before stable 1.0 release
<mps>
aarch64, I mean
<mps>
we had it in alpine till the november previous year, but because llvm changes we had to remove it
oddp has joined #crystal-lang
frojnd has joined #crystal-lang
<frojnd>
Hi there.
<frojnd>
I'm just following one tutorial and I have a question regarding Exceptions.... WHen using `rescue e : Errno` I get: Error: Errno is not a subclass of Exception
<FromGitter>
<Nicolab> It used to be an subclass exception, but not anymore.
<frojnd>
I think I should rescue `Socket::ConnectError`
<FromGitter>
<Blacksmoke16> `rescue e : Socket::ConnectError`?
<FromGitter>
<bararchy> does compiling with `--debug` does anything other then add debug info to the bin? as in, does it effect execution at any wau?
<FromGitter>
<bararchy> (speed, behavior, etc..)
<FromGitter>
<Blacksmoke16> maybe makes the binary bigger?
<FromGitter>
<bararchy> but runtime changes?
<jhass>
I hope not :)
<jhass>
I mean nothing is stopping anybody from doing flag?(:debug) checks, but...
<frojnd>
Ok so specific classess ...
<FromGitter>
<bararchy> so.. if I have code that sigfaults when `--release` but doesn't sigfault with `--debug --release` we should all be scared?
<FromGitter>
<Blacksmoke16> *doom*
<frojnd>
Well I like that
<frojnd>
I get an exception and I just copy paste it there
<FromGitter>
<Blacksmoke16> ofc you can also rescue parent exception types
<FromGitter>
<j8r> @mattrberry 69120, wow!
<FromGitter>
<j8r> You used `0...N` right?
sarmonsiill has quit [Ping timeout: 256 seconds]
<FromGitter>
<j8r> I can reproduce it
<FromGitter>
<j8r> seems to be really too big for LLVM
<FromGitter>
<mbrc12> Hey, sorry if this is the wrong place to ask. But I'm trying to use https://github.com/brantou/lsp-crystal.el/blob/master/lsp-crystal.el . However, using `(add-hook 'crystal-mode-hook #'lsp)` gives a weird `Unknown notification` everytime I type anything while writing some crystal code.
<jhass>
barachy: Well, debug info still is part of the ELF, so it shifts memory layout when loading the process. You're probably just lucky
<FromGitter>
<j8r> @Blacksmoke16 thanks
<FromGitter>
<bararchy> or unlucky depends on what's the end goal XD
<jhass>
barachy: meaning you have some memory corruption either way, --release, --debug, either, both, none. Some combinations just make it corrupt unimportant memory
<FromGitter>
<bararchy> jhass, you failed at failing
<jhass>
but how did I fail at failing? What's failing at failing reason number 504547392?
Human_G33k has quit [Quit: Leaving]
rocx has quit [Ping timeout: 260 seconds]
rocx has joined #crystal-lang
HumanG33k has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
<raz>
hmm... my github actions start failing with "Retrieving the default branch name - Not Found"
<raz>
brrr found it. they broke checkout of private repos with ssh over the idiotic branch renaming discussion
<raz>
if you bump into it, adding an explicit `ref: master` fixes it
<FromGitter>
<Blacksmoke16> f
<oprypin>
raz: aaaaaaaaaaaaaaaaaaaaaaa
<raz>
yes, that about sums up my feeling
<FromGitter>
<kinxer> Is the default branch name going to be "primary" or "default" or something now?
<raz>
i don't know. but if they break one more thing i'm gonna rename all my masters to white-cotton-farmer
<FromGitter>
<kinxer> Well, maybe no.
<FromGitter>
<kinxer> Are they just not providing good migration paths for names or what?
<raz>
the whole idea has to be aborted and everyone involved has to be fired
<jhass>
please. Not here.
<raz>
sorry, just had this channel open when it bit me
<FromGitter>
<phykos> how do C bindings work (not how to use them, but how they are written etc.)? ⏎ it's a LLVM feature?
<jhass>
phykos: basically yes. LLVM IR works on modules, which you can think of as compilation units. There's instructions to define an external symbol to a module. Then we compile the modules to normal object files and let the linker do its job
<jhass>
that's not a distribution package though, you'll need to clone the repo, place the binary at .build/crystal and run make deps, then use bin/crystal
<FromGitter>
<phykos> saw
<jhass>
whatcha running? I mean distro
<FromGitter>
<phykos> Manjaro
<FromGitter>
<phykos> RPi4
<jhass>
huh, didn't know they got aarch64 builds
<jhass>
anyways, I'll probbaly try to coax the alarm folk into shipping a aarch64 package one of these days
<jhass>
that should be installable on manjaro then
<FromGitter>
<phykos> so now I have the compiler, but for the shards? ⏎ how do I compile shards with only the compiler?
<jhass>
just get the shards repo from github and run make :)
<jhass>
I mean you'll need the bin/crystal wrapper in $PATH I guess
<FromGitter>
<phykos> oh kk
<jhass>
oh, actually you can do make CRYSTAL=/path/to/it as well
<mps>
we are near first working crystal 0.35.0 apk for alpine/aarch64
<jhass>
🎉
<FromGitter>
<bararchy> jhass sounds like my kind of bugs ahaha
<jhass>
also of course it's an openssl spec
<FromGitter>
<bararchy> now try with `--debug` and `--no-debug` for the kicks
<FromGitter>
<bararchy> ahahah
<frojnd>
I'm trying to find any documentation rather than examples for this parser shard: https://github.com/kostya/myhtml is there any better documentation?
<FromGitter>
<Blacksmoke16> could maybe pull it down and build the docs for it
<frojnd>
I mean in example there are .nodes but I have no idea what this is
<FromGitter>
<Blacksmoke16> probably similar to XML
<FromGitter>
<Blacksmoke16> node being a set of tags under another tag
<jhass>
mps: btw once you got time to share, I'm still curious about the trouble with the valist changes you had :)
<FromGitter>
<rishavs> I had used heredoc instead of ECR for the veiws as I couldn't embed one ECR into another (for creating components of the page). I wonder if that way is actually good
<FromGitter>
<manveru> man... the AWS API is really obnoxious to map to crystal
<FromGitter>
<manveru> does anyone have a library for this stuff, or some JSON.mapping generator?
<hightower3>
It's listed in my activity feed on github since I'm following you. Not much is visible though, just that you created the 'api' repository
<FromGitter>
<Blacksmoke16> ah
<FromGitter>
<Blacksmoke16> making a site related to a game i play(ed)
<hightower3>
Ah ok. Thought it was something e-commerce related, which would be of interest to me :)
<FromGitter>
<Blacksmoke16> kinda but for in game money :p
<FromGitter>
<Blacksmoke16> The game (https://esi.evetech.net/ui/) has very good third party develop support. I.e. static data exports and APIs
<FromGitter>
<Blacksmoke16> plan is to make a web app to view public contracts available, like you can do in game, but with more information/features
<FromGitter>
<Blacksmoke16> wanted to make it for a while, but then one thing lead to another and before you knew it i was working on a web framework instead 😆
<hightower3>
:)
<hightower3>
Do you know how it compares to Vendetta Online?
<hightower3>
(Or Star Citizen lol :)
<FromGitter>
<Blacksmoke16> less scale than star citizen,, but been around for quite a while
<FromGitter>
<Blacksmoke16> its known for the sandbox, player driven economy, and large battles and meta plays
<hightower3>
yeah just read the wikipedia page on it
<FromGitter>
<Blacksmoke16> and that like scamming, blackmail, espionage is all legal