greengriminal has quit [Quit: This computer has gone to sleep]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
<FromGitter>
<konovod> my atom has broken after last update (`crystal-ide` conflicts with `language-crystal-actual` or something like this) π Tried to use vscode but it's too painful. Sublime looks fine. Git support is much worse, but autocomplete and formatting works like charm.
linuksz has joined #crystal-lang
<linuksz>
how can i access command line arguments?
<FromGitter>
<cevarief> @faustinoaq How to integrate scry with vscode-crystal-lang? Compiling scry got me error. Missing a lot dependency of requires.
greengriminal has joined #crystal-lang
gloscombe has joined #crystal-lang
bmcginty has quit [Ping timeout: 248 seconds]
bmcginty has joined #crystal-lang
w-p has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 255 seconds]
rohitpaulk has joined #crystal-lang
<Papierkorb>
konovod, is sublime OSS or even free software?
<FromGitter>
<bararchy> It's not
<FromGitter>
<bararchy> it's free like winrar is free, every x saves it will ask you to buy a license, though it wont stop working
<Papierkorb>
"like winrar free" while true, is in itself a kinda hilarious statement. "Free as in beer" "free as in winrar"
<FromGitter>
<bararchy> XD
<FromGitter>
<bararchy> yeha lol
<FromGitter>
<straight-shoota> I really like sublime but I've also come to like vscode, especially for better Crystal support and git integration. @konovod why is it painful?
<FromGitter>
<bararchy> vscode ? or the linux version ... I think it's called code
<Papierkorb>
I also "discovered" a memory leak in atom over the last two days, occuring when you're updating files from outside while having them open at some point during the lifetime of the process. That those files are comparably huge doesn't help. OTOH, atom did display a "ENOMEM" error without crashing, so that was nice.
<FromGitter>
<krypton97> There's bunch of sublime licenses on the internet
<Papierkorb>
How bad is it? It accumulated about 25GiB of residential memory by that point.
<FromGitter>
<bararchy> How do I install the Crystal tools for vscode ?
<FromGitter>
<konovod> @straight-shoota i don't know. maybe it's personal taste. But everything that is nice in atom is broken in vscode. Terminal is littered with special symbols, terminal window don't scrolls down automatically, no autoformatting on save, no highlighting of changed files in project, alt-shift shortcuts don't work on cinnamon (calls menu instead). and many such small things. And it's not "duck syndrome" - i haven't
<FromGitter>
... tried sublime before too, but it feels "right", the only thing it lacks is git integration.
snsei has joined #crystal-lang
greengriminal has quit [Quit: Leaving]
snsei has quit [Ping timeout: 246 seconds]
DTZUZO has joined #crystal-lang
<FromGitter>
<bararchy> @konovod what Crystal plugin do you use in Aom ?
<FromGitter>
<konovod> `crystal-ide`, but it don't works without `language-crystal-actual`.
DTZUZO has quit [Ping timeout: 240 seconds]
<FromGitter>
<bararchy> @konovod Can it work with scry ?
<FromGitter>
<konovod> according to scry readme, yes. But for now it doesn't works for me at all.
<FromGitter>
<bararchy> Hm... did anyone tried using Sublime with scry ?
DTZUZO has joined #crystal-lang
w-p has quit [Ping timeout: 246 seconds]
<FromGitter>
<krypton97> How can I execut a function right before I close the app?
<FromGitter>
<krypton97> e
<FromGitter>
<krypton97> Something like defer in go
<FromGitter>
<sdogruyol> @krypton97 you should use `at_exit`
<FromGitter>
<faustinoaq> Clone the Scry repo and compile it
<FromGitter>
<faustinoaq> Then configure the path for scry executable on settings.json
<FromGitter>
<faustinoaq> @cevarief But I recommend you to use the extension with `"crystal-lang.problems": "build"`
<FromGitter>
<faustinoaq> Scry is still on development
<FromGitter>
<konovod> @faustinoaq I don't have problems with your extension, it is awesome (well, except maybe autoformatting on save). i have problems with vscode in general
<FromGitter>
<cevarief> > @cevarief But I recommend you to use the extension with `"crystal-lang.problems": "buildβ` β Ok thanks.
<FromGitter>
<faustinoaq> @konovod π I do use auto formatting on save and works well, Are you using some specific settings? β β @bararchy I think so, However, as long I know Sublime LSP only supports go to definition and linting, not formatting. β β @cevarief Scry compiles well, you need llvm installed in your enviroment. ... [https://gitter.im/crystal-lang/crystal?at=599445fe76a757f808ade60b]
<FromGitter>
<bararchy> LSP should also supprt Hover by looking at there wiki, but it seems not to really work
<FromGitter>
<faustinoaq> No, Scry LSP Hover is not in master yet. Hover works with Node.js backend.
<FromGitter>
<bararchy> Oh....
<FromGitter>
<bararchy> Ok, thanks :)
w-p has joined #crystal-lang
<FromGitter>
<faustinoaq> You need to remove `"crystal-lang.server": "/absolute/path/bin/scry"` from your settings to enable Node.js backend. Otherwise Scry is called.
<FromGitter>
<konovod> > I do use auto formatting on save and works well β hmm, what setting controls it? I installed it and didn't changed anything, and it don't formats on save, only by calling command (alt-shift-f, and this shortcut isn't working).
hightower2 has quit [Ping timeout: 240 seconds]
<FromGitter>
<konovod> hmm, what setting controls it? I installed it and didn't changed anything, and it don't formats on save, only by calling command (alt-shift-f, and this shortcut isn't working).
<FromGitter>
<krypton97> Try alt+shift+i
<FromGitter>
<konovod> i want ctrl-s π
<watzon>
Why aren't there build instructions for Scry? It seems like every time I try to build it I hit hangups
<watzon>
`main_module:(.text+0x26d48): undefined reference to `ERR_load_crypto_strings'`
<watzon>
I have openssl installed, so idk what's going on
<FromGitter>
<krypton97> Fastest way to find out is compiling, but there's no defmodule keyword
<FromGitter>
<bew> @zatherz won't work for float numbers I think
<FromGitter>
<zatherz> why?
<FromGitter>
<bew> nvm it works
<FromGitter>
<bew> was thinking: `self` & `0` are different types
<FromGitter>
<zatherz> crystal has operator overloading
<FromGitter>
<bew> can be*
<FromGitter>
<mgarciaisaia> @muhajirframe I think the pattern matching you're looking for isn't there
<FromGitter>
<mgarciaisaia> That's too typical of functional languages, though
<FromGitter>
<zatherz> what's the name of the `x[0]` AST node? I can't find it for the life of me
<FromGitter>
<bew> @muhajirframe you can use method overloading though: `def zero?(x : Int); ...; end`
<FromGitter>
<bew> @zatherz you can use `{% puts some_ast_node.class_name %}` to help you
<FromGitter>
<zatherz> ah so it's `class_name`
<FromGitter>
<zatherz> oooh, it's Call
<FromGitter>
<zatherz> which makes sense because `a[1]` is `a. (1)`
<FromGitter>
<muhajirframe> I am little bit confused with answer hehe. Well, it's my bad, not asking specific question. My main point is here the `when` keyword. It's like overloading `def` we have in crystal. But conditional like `is_integer`.
snsei has quit [Remote host closed the connection]
<FromGitter>
<zatherz> trying to write something big with macros in crystal is sucking the life force out of me
<FromGitter>
<bew> Are you sure you need macros to do it?
<FromGitter>
<zatherz> JSON parser generator, like JSON.mapping but with a lot more features that I need for https://gitlab.com/zatherz/dcr
<FromGitter>
<bew> Oh
<FromGitter>
<zatherz> I wonder how much would have to be changed to make it possible to use `def`s in macros
<FromGitter>
<zatherz> the main problem is that I have to copy paste a lot in the macro code
<FromGitter>
<krypton97> copy paste is fun
<FromGitter>
<zatherz> and then if I change it I have to appropriately change it everywhere it's copy pasted
<FromGitter>
<bew> Do you have an example?
<oprypin>
zatherz, you can have macros that produce macro calls
<FromGitter>
<zatherz> yeah, but you can't execute macros inside macros
<oprypin>
yeah, but you can have macros that produce macro calls
<FromGitter>
<zatherz> I thought about that, I'll end up with macros that produce macros that produce macros lol
<FromGitter>
<zatherz> but it may be worth it, even if it doesn't look too good
<FromGitter>
<bew> Do you have an example where copy/pasting is need for you?
<FromGitter>
<zatherz> not in code (I deleted it to rewrite it) but I can explain one particular example
<FromGitter>
<zatherz> basically, I want the generator to have the ability to extract "dependency" fields that have to be extracted before other fields
<FromGitter>
<zatherz> then those other fields can use the dependency fields in their constructors etc
<FromGitter>
<zatherz> there are a couple of ways to do that, but let's say I want to do it the "naive" way, i.e. doing pull_parser.read_object two times
<FromGitter>
<zatherz> I have to copy the code that decides where to call from_json (the converter? the type? the union?) two times
<FromGitter>
<zatherz> and if I e.g. want to add some extra converter options, I have to remember to change it in two places
<FromGitter>
<zatherz> `String => Nil` above should be `Symbol => Nil`
<FromGitter>
<zatherz> what that does is check if the constant has no elements, if it does (the only case where a type has to be specified) return `{} of Symbol => Nil`, otherwise return the literal and let Crystal infer the type
<FromGitter>
<zatherz> the reason it has to have a typeless value is because it's a symbol to type map
<FromGitter>
<krypton97> I'm looking to port it to crystal
<FromGitter>
<krypton97> Couldn't find an auth package
linuksz has quit [Quit: Leaving.]
<FromGitter>
<HCLarsen> I was just reading that there's no central repository for shards, and that you get them straight from github. If that's the case, then how do you know what kinds of shards are out there?
<FromGitter>
<johnjansen> look at the last few lines
<FromGitter>
<LuckyChicken91_twitter> i know but i dont understand them
<FromGitter>
<LuckyChicken91_twitter> uh i think it wasnt the index. its the item
<FromGitter>
<johnjansen> so you only want items that pass the test?
<FromGitter>
<johnjansen> use `Array.select`
<FromGitter>
<faustinoaq> > So I'm on Arch (actually Manjaro) and can't build anything with Crystal that requires openssl β β *watzon:* lol, I use Manjaro too as main OS since 2015 and I'm still trying to reproduce your problem
<FromGitter>
<faustinoaq> And my computer is not powerfull at all
<FromGitter>
<krypton97> I'm using solus and seems to be stable
<FromGitter>
<krypton97> Had a lot of issues with ubuntu
<FromGitter>
<faustinoaq> For me almost any distro works well with crystal, I have Alpine, Ubuntu, CentOS and Manaros all of them running latest Crystal without problemsπ
<FromGitter>
<krypton97> I wasn't reffering to crystal at all
<FromGitter>
<faustinoaq> > Arch does not have this problem. Manjaro is broken β β *oprypin:* lol, I use Manjaro as main OS and I don't have problems with Crystal installation/compilation at all. In fact, I can compile some static binaries using Manjaro.
<FromGitter>
<krypton97> more like kernel issues
onionhammer has quit [Ping timeout: 240 seconds]
onionhammer has joined #crystal-lang
onionhammer has quit [Client Quit]
<Papierkorb>
.... openssl issues sound like issues with the openssl installation.
<oprypin>
delef, again you are assuming everyone knows ruby. if you had specified a proper question, I would be able to answer many hours ago, otherwise I can't
<FromGitter>
<bararchy> I think I'll open a bug, it seems that no matter what fool proff logic I put there the compiler still complains on wrong types
<oprypin>
delef, I must put an accent on the fact that Strings in Crystal must not store arbitrary bytes, that's why String has no participation here, instead it's a Slice of bytes
<oprypin>
bararchy, if you can isolate it, sure. i dont believe this is possible, as is
<FromGitter>
<bararchy> oprypin, what do you mean ? as in that it only happens at my env because of complex code leading up to it ?
<FromGitter>
<bararchy> If so, then I can't sadly dump all the project to the issue
<FromGitter>
<bararchy> haha
<oprypin>
well exactly, that's why you have to chop off parts of it until it's suitable for an issue
<FromGitter>
<bararchy> damn ...
<FromGitter>
<bararchy> lol
<FromGitter>
<crisward> @bararchy I'm using client.get without issue, though I'm not using .is_a? before it
<FromGitter>
<bararchy> why is this a dynamic set?
<FromGitter>
<bararchy> lol nvm typo
ihaveaquestion has joined #crystal-lang
<FromGitter>
<bararchy> I'm too tired to debug this right now :/ I'll try to trace tomorrow
Groogy has joined #crystal-lang
<Groogy>
Hiya!
ihaveaquestion has quit [Quit: Page closed]
<Papierkorb>
Yo Groogy
<Groogy>
Went on vacation, came back and my brain suddenly figured out why >2.0 GL versions doesn't work
<Groogy>
because I need to reload the library after creating the opengl context somehow
<Papierkorb>
So if for nothing else, vacation helped ;P
<Groogy>
I could potentially also I guess make a intermediary C lib I guess that handles it for you I guess?
<Groogy>
probably better than to figure out how to abuse DL module in Crystal
<Papierkorb>
Well technically, you *can* use libdl from Crystal
<Groogy>
I know, but I think it is more complex than that, because of the architecture of OpenGL
<Papierkorb>
You just have to abuse Proc, but god bless it has an #initialize you can use to explicitly set the function pointer and context (which is probably irrelevant for C)
<Groogy>
and I can't really just use GLEW I think in Crystal
<Papierkorb>
is it that magic?
<Groogy>
yeah
<Groogy>
that's what is missing
<Papierkorb>
C macro magic?
<Groogy>
yepp
<Papierkorb>
>_>
<Groogy>
so thinking of doing a C lib that runs GLEW and let's you that way access the functions in Crystal
<Groogy>
unless you have some awesome magic trick I could do to make it even easier ^^
<Papierkorb>
Generate as much as possible
<Papierkorb>
But never used GLEW, no idea about it
<Groogy>
not exactly sure what it does, but it requires you to include it in correct order with GL headers. So yeah macro magic happens