RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.1 | 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
<t0nyandre> The easiest way is to use "web-mode.el" and use (add-to-list 'auto-mode-alist '("\\.ecr\\'" . web-mode))
<t0nyandre> as far as I can see I have full emmet support through that melpa package
alex`` has quit [Ping timeout: 265 seconds]
<FromGitter> <codenoid> hi
<FromGitter> <codenoid> can somebody help me to upgrade the C library of https://github.com/datanoise/mongo.cr
<FromGitter> <codenoid> `libmongoc version 1.1.0` always failing
faustinoaq has quit [Ping timeout: 240 seconds]
<FromGitter> <codenoid> i move to python for a while bcoz that library is broken
faustinoaq has joined #crystal-lang
<RX14> just stop using mongodb and use a real database
<crystal-gh> [crystal] RX14 closed pull request #5837: Use crystallang/crystal:nightly tag for nightly releases on docker (master...circleci-docker-nightly-tag) https://git.io/vxO8s
<FromGitter> <faustinoaq> > just stop using mongodb and use a real database ⏎ ⏎ Why? I don't think is a good answer πŸ˜… I think developers should be able to use whatever library they want :shipit:
<faustinoaq> @codenoid Sadly, We depend on shards maintainers and contributors :(
<FromGitter> <faustinoaq> And because crystal is not stable yet, old shard aren't aware of new breaking changes
<travis-ci> crystal-lang/crystal#c0cdbc2 (master - Use crystallang/crystal:nightly as docker nightly tag (#5837)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/354881479
<DeBot> https://github.com/crystal-lang/crystal/pull/5837 (Use crystallang/crystal:nightly tag for nightly releases on docker)
<FromGitter> <faustinoaq> > Anyone want to take a stab here ⏎ ⏎ @jwaldrip Done! πŸŽ‰
return0e has quit []
hightower has quit [Ping timeout: 256 seconds]
snsei has quit [Remote host closed the connection]
qard has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 265 seconds]
<FromGitter> <bajro17> Hi :)
<FromGitter> <bajro17> I come back after some time
<FromGitter> <bajro17> still same question bother my mind
<FromGitter> <bajro17> is there any coin implemented in crystal :D
<FromGitter> <bevo009> Hi! have a noob ruby-to crystal question ⏎ array.reverse! works as in Ruby, but... "string".reverse! doesn't exist in the Crystal docs, although plain .reverse is there ⏎ How to apply reverse method to the original file?
<FromGitter> <bajro17> are you try with something like this puts "crystal".reverse ?
<FromGitter> <codenoid> any reason for that @RX14 ? :/
duane has quit [Ping timeout: 240 seconds]
duane has joined #crystal-lang
qard has quit [Quit: qard]
<FromGitter> <bevo009> yeah, "string".reverse works, but NOT "string".reverse! (which applies reverse to the file, not a copy...I get this error:
<FromGitter> <bevo009> =>undefined method 'reverse!' for String (did you mean 'reverse'?)
<FromGitter> <bevo009> Plus .reverse! doesn't exist in the docs, so I assume there is another way
<FromGitter> <mamantoha> strings are immutable in crystal https://crystal-lang.org/api/master/String.html
<FromGitter> <faustinoaq> > is there any coin implemented in crystal ⏎ ⏎ Hi @bevo009 Check https://github.com/SushiCoinHQ/SushiCoin and https://www.reddit.com/r/sikoba/comments/7yzy2l/sikoba_supports_crystal/ πŸ˜‰
<FromGitter> <faustinoaq> @bevo009 Yeah, as @mamantoha said strings are inmutable in crystal, we have more inmutable things as well: Tuple, NamedTuple, Struct and Record, StaticArray, etc.
<FromGitter> <codenoid> yo, you can make PR for that @bevo009
<FromGitter> <codenoid> with issue first
<faustinoaq> @codenoid I think MongoDB is a pretty popular tool, Sadly we depend on shards maintainers and collaborators to fix breaking changes, Perhaps RX14 misunderstood something ;)
<FromGitter> <bajro17> Thank you @faustinoaq I find sushi look so good
<FromGitter> <faustinoaq> Yeah πŸ‘
<FromGitter> <faustinoaq> @codenoid @bajro17 What's the use case of `"string".reverse!` I can't find one πŸ˜…
<FromGitter> <bajro17> few min before I have discussion with golang developer and I mention this community how fast all of you answers they promote golang like so popular but wait answers few days
<FromGitter> <bajro17> @faustinoaq I dont ask for reverse! on string :D this is question from @bevo009
<faustinoaq> Oh, my bad ;)
<FromGitter> <bevo009> yeah it's in the 'learn Ruby' tutorial on their site ⏎ so I assume it's used for something :) I don't know, I'm very noob ⏎ .delete is missing also ⏎ what is the workaround or crystal way? [https://gitter.im/crystal-lang/crystal?at=5aadeceb458cbde55748ba49]
<FromGitter> <bevo009> sorry .delete! I meant
<FromGitter> <bajro17> same case strings is immutable
<FromGitter> <bevo009> ahh ok...that's why it works on arrays then
<FromGitter> <bevo009> I'll add that to my 'ruby code that doesn't compile in crystal' file
<FromGitter> <bevo009> thanks
<FromGitter> <redcodefinal> How do you make a shard have submodules you can `require`? For example ⏎ ⏎ ```require "actual_shard_name" ⏎ require "actual_shard_name/dev"``` [https://gitter.im/crystal-lang/crystal?at=5aadf14827c509a77475a53a]
<FromGitter> <redcodefinal> I took a look at this earlier but when I've tried loading sub directories in my shard from the outside and it can't find the file. directory structure (https://github.com/redcodefinal/pixel_lang_crystal/tree/master/src/pixel_lang_crystal) ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Outputs: ... [https://gitter.im/crystal-lang/crystal?at=5aadf8c7458cbde55748d8bb]
<FromGitter> <redcodefinal> Is it possible that I can't require like this if I haven't required the files themselves in the library itself? I wanted to keep `dev/helpers` out of the main library when `require "pixel_lang_crystal"` is used and have the user require `dev/helpers` only if needed.
<FromGitter> <redcodefinal> Ok so I can require this seperately but I can't use the glob outside the shard it seems.
<FromGitter> <redcodefinal> I
return0e has joined #crystal-lang
<FromGitter> <unn4m3d> Π― знаю Π±ΠΎΠ³ Ρ…ΠΎΡ‚ΡŒ ΠΎ ьъз
alex`` has joined #crystal-lang
Majost_ has joined #crystal-lang
aarongodin_ has joined #crystal-lang
Majost has quit [Read error: Connection reset by peer]
aarongodin has quit [Read error: Connection reset by peer]
aarongodin_ is now known as aarongodin
Majost_ is now known as Majost
olbat has quit [Ping timeout: 260 seconds]
olbat has joined #crystal-lang
olbat has joined #crystal-lang
<FromGitter> <unn4m3d> Sorry, it seems my pocket has its own mind that sends messages from my phone :)
DTZUZO_ has quit [Ping timeout: 246 seconds]
_whitelogger has joined #crystal-lang
bmcginty has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
<FromGitter> <r00ster91> how do I create a getter method of a @@class_variable? ⏎ when I do ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5aae284ca60157d62ffd8a37]
rohitpaulk has joined #crystal-lang
<FromGitter> <straight-shoota> Use `class_getter`
<FromGitter> <straight-shoota> And lose the `new`. It's not an instance method
<FromGitter> <r00ster91> ah ok i did not know `class_getter` exist thx
hightower has joined #crystal-lang
<FromGitter> <aisrael> @watzon Am trying to use your extensions. Added `github: watzon/extensions` to my dependencies but if I just try to go `hash.map_keys {...}` I get `undefined method 'map_keys' for Hash`. ⏎ ⏎ I had to go `require "extensions/core/hash" for it to work.
rohitpaulk has quit [Ping timeout: 248 seconds]
That_Guy_Anon has joined #crystal-lang
faustinoaq has quit [Quit: IRC client terminated!]
hightower has quit [Ping timeout: 256 seconds]
emilsp has joined #crystal-lang
<FromGitter> <faustinoaq> > Ok so I can require this separately but I can't use the glob outside the shard it seems. ⏎ ⏎ @redcodefinal Just create a fine in your shards that require all inside a dire, by example: ⏎ ⏎ ```# helpers.cr ⏎ ⏎ require "./helpers/**"``` [https://gitter.im/crystal-lang/crystal?at=5aae3a52458cbde55749bcde]
<FromGitter> <faustinoaq> Some similar to `__init__.py` in Python πŸ˜…
bmcginty has joined #crystal-lang
<FromGitter> <unn4m3d> `.../dev/helpers/helpers.cr` can be used as well IIRC
<FromGitter> <faustinoaq> πŸ‘
<FromGitter> <faustinoaq> Hey community! Mint project looks super interesting https://www.mint-lang.com/ ⏎ ⏎ https://files.gitter.im/amberframework/amber/G3X0/Screenshot_20180318_060603.png
<FromGitter> <faustinoaq> ^ https://www.mint-lang.com/
<FromGitter> <faustinoaq> by @gdotdesign πŸŽ‰
<FromGitter> <faustinoaq> Mint Lang remember me to QML a bit πŸ˜…
<FromGitter> <faustinoaq> BTW, Mint webpage is made using Mint πŸ‘ https://github.com/mint-lang/mint-website
<FromGitter> <unn4m3d> looks like a typo
<FromGitter> <unn4m3d> front-end, not font-end
<FromGitter> <faustinoaq> Oh, yeah you found the first issue πŸŽ‰ πŸ˜„
<FromGitter> <bararchy> the same typo is in the crystal ann anouncment
<FromGitter> <faustinoaq> πŸ˜…
<FromGitter> <faustinoaq> @unn4m3d πŸ‘ ✨
<FromGitter> <lipanski> hello
<FromGitter> <lipanski> I think I stumbled over an inconsistency in the subclasses macro
<FromGitter> <lipanski> wanted to ask for an extra opinion before I open an issue
<FromGitter> <lipanski> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5aae4ffc27c509a77476dd05]
<FromGitter> <lipanski> without the explicit type restrictions this all works fine
<FromGitter> <lipanski> but when having only one sublcass of a given class, the subclasses macro is typed to the subclass
<FromGitter> <lipanski> and I guess this is intended behaviour because there was a spec for this somewhere
<FromGitter> <lipanski> but it's very old
<FromGitter> <lipanski> this one
<FromGitter> <faustinoaq> Hi, I'm thinking crystal syntax is friendly enough (Thank you Ruby πŸ˜„) to allow non-backend developers to do low level stuff, compared to other compiled languages crystal is easy peasy πŸ˜‰ ✨
<FromGitter> <faustinoaq> @lipanski Yeah, your issue seems a crystal bug, you can try this workaround: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ https://carc.in/#/r/3qzf [https://gitter.im/crystal-lang/crystal?at=5aae52b76f8b4b99463da4f5]
<FromGitter> <unn4m3d> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5aae52c3bb1018b37af95a60]
<FromGitter> <faustinoaq> Oh @unn4m3d you're right πŸ‘
<Groogy> Hello! o/
<FromGitter> <faustinoaq> Hi! :)
<FromGitter> <lipanski> @faustinoaq oh cool, that does the trick
<FromGitter> <lipanski> @unn4m3d your suggestion errors with ` unexpected token: of`
<FromGitter> <lipanski> both of them
<FromGitter> <lipanski> on 0.24.1 at least
<Groogy> because he hasn't written that it should be an array literal
<Groogy> add [ ] arround the macro {{}}
<Groogy> that should fix it I think
<Groogy> yes that is an array, but not a literal one
<Groogy> oh wait nvm
<FromGitter> <lipanski> ah, forgot the begin/end macro stuff => thanks @unn4m3d
<Groogy> Yeah, if it's in a macro it gets expanded as expected
<Groogy> I've been gone from Crystal too long ^^
<FromGitter> <faustinoaq> https://files.gitter.im/sdogruyol/kemal/zCNT/Screenshot_20180318_070157.png ⏎ ⏎ ^ Wow, Crystal + Kemal + Mint πŸŽ‰
<Groogy> Isn't mint an ubuntu clone? :S
<Groogy> or that a new shard?
<FromGitter> <faustinoaq> Groogy, No, That's Linux Mint XD
<Groogy> ^^
<FromGitter> <faustinoaq> This is Mint Lang https://www.mint-lang.com/
<FromGitter> <faustinoaq> Made using Crystal ✨
<Groogy> hahaha
<Groogy> so when the devs said "Crystal is a language made to make languages" I didn't expect anyone to take them up on it
<FromGitter> <faustinoaq> ^ Awesome!!!, hot reloading out-the-box 😍
<FromGitter> <faustinoaq> ^ Surprisingly, it doesn't use NPM at all ✨
<Groogy> so it's a language to create webpages?
<FromGitter> <faustinoaq> ^ yeah, just like Elm, but more QML, React alike
<Groogy> Is the language interpreted or compiled?
<FromGitter> <faustinoaq> I guess is interpreted with types but compiles to HTML, CSS and JS
<FromGitter> <faustinoaq> Types CSS, OMG 😎
<Groogy> just wondering if it is interpreted on request or it is precompiled somehow
<FromGitter> <faustinoaq> Check the source code https://github.com/mint-lang/mint
<FromGitter> <faustinoaq> Looks like his author is a very active Elm user, Wondering Why he created Mint πŸ˜…
<FromGitter> <faustinoaq> ( ping @gdotdesign )
<FromGitter> <gdotdesign> Hey :) I can't talk much now but I'll be available probably tomorrow ;)
<FromGitter> <faustinoaq> Hi @gdotdesign Thank you so much for creating Mint! πŸŽ‰
<FromGitter> <bararchy> @gdotdesign looks interesting :)
<Groogy> Welp I'm lucky Crystal is still far from 1.0 for my promise, haha
<Groogy> though how is threaded and windows support going?
<FromGitter> <gdotdesign> @faustinoaq you are welcome :) however it's pretty much pre-alpha stage
<FromGitter> <faustinoaq> > so when the devs said "Crystal is a language made to make languages" I didn't expect anyone to take them up on it ⏎ ⏎ Groogy, Yep, that's it, There is a plenty of languages created using crystal now https://github.com/veelenga/awesome-crystal#implementationscompilers
<FromGitter> <gdotdesign> currently working on the first public release :D so any feedback is quite welcome
<FromGitter> <faustinoaq> @gdotdesign No problem, your project looks very promising πŸ˜„ πŸ‘
<That_Guy_Anon> on the mint webside the link to examples gives a 404 ^^
<FromGitter> <gdotdesign> yeah, they are currently on the website repo the plan is to move them to their own
<FromGitter> <greenbigfrog> Probably just got sth wrong here... but if I have some json where a Int is sent as String, how can I parse it as a Int in a JSON.mapping?
<FromGitter> <faustinoaq> > on the mint webside the link to examples gives a 404 ^^ ⏎ ⏎ That_Guy_Anon, Are you sure? for me examples works just fine
DTZUZO_ has joined #crystal-lang
<FromGitter> <faustinoaq> ^ Drag me example
<FromGitter> <faustinoaq> https://www.mint-lang.com/drag
<That_Guy_Anon> faustinoaq might be because i wasnt logged into github?nope, even when logged in i get the cute 404.
<FromGitter> <faustinoaq> > but if I have some json where a Int is sent as String, how can I parse it as a Int in a JSON.mapping? ⏎ ⏎ @greenbigfrog I think you can use a converter
<That_Guy_Anon> i used the link at the bottom of the page, maybe there is a typo or so?
<FromGitter> <faustinoaq> > converter: specify an alternate type for parsing and generation. The converter must define from_json(JSON::PullParser) and to_json(value, JSON::Builder) as class methods. Examples of converters are Time::Format and Time::EpochConverter for Time. ⏎ ⏎ ^ https://crystal-lang.org/api/0.24.2/JSON.html
<FromGitter> <faustinoaq> That_Guy_Anon, That's strange, I tried Firefox and chome, both working fine πŸ˜…
<That_Guy_Anon> huh
<That_Guy_Anon> curious
<FromGitter> <faustinoaq> ^ Using Firefox
<That_Guy_Anon> ah. the link at the bottom of the page takes you to a github-repo
<That_Guy_Anon> that doesnt exist yet. the one on the top stays on the page and shows the examples there ^^
<FromGitter> <faustinoaq> Yeah πŸ˜… Its a broken link, you just found the second issue πŸŽ‰
<FromGitter> <gdotdesign> it's work in progress guys :D :D
<That_Guy_Anon> looks already better than everything i could do :P
<FromGitter> <faustinoaq> > Yeah πŸ˜… Its a broken link, you just found the second issue πŸŽ‰ ⏎ ⏎ First one here (https://gitter.im/crystal-lang/crystal?at=5aae4ccafa066c5325428473) πŸ˜‰
<FromGitter> <faustinoaq> @gdotdesign I'm just curious, looks like you're an active Elm developer too, if may I ask you why you created Mint Lang? πŸ˜ƒ
<FromGitter> <greenbigfrog> yeah... been looking at a converter but smh I'm now getting `expected string, but was int`... ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5aae657427c509a774773ab5]
<FromGitter> <straight-shoota> Jon
<FromGitter> <straight-shoota> You're
<FromGitter> <straight-shoota> (damn mobile site)
<FromGitter> <straight-shoota> You're asking the pull parser for a string, but it encounters an int
<FromGitter> <straight-shoota> Hm but that shouldn't be an issue
<FromGitter> <straight-shoota> Oh you have to call a read method on the parser
<RX14> oh wow mint is cool
<RX14> i was like "how does that relate to crystal" at first
<FromGitter> <greenbigfrog> weird... earlier read_string wasn't working... thanks
<crystal-gh> [crystal] CImrie closed pull request #5777: [WIP] OpenSSL RSA Bindings (master...feature/openssl-rsa) https://git.io/vA59D
<FromGitter> <gdotdesign> I've created a new room for Mint if anyone is interesed https://gitter.im/mint-lang/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link
<FromGitter> <faustinoaq> πŸ‘
DTZUZO_ has quit [Quit: WeeChat 2.0]
<FromGitter> <bararchy> how can I get the size of a struct ?
<FromGitter> <straight-shoota> `siezeof` ?
<FromGitter> <bararchy> ```struct Foo ⏎ int : Int32 ⏎ uint : UInt32 ⏎ end``` ⏎ ⏎ How can I get the totaly byte size this struct can now host [https://gitter.im/crystal-lang/crystal?at=5aae7397c3c5f8b90d8693f5]
<FromGitter> <bararchy> as in (Int32 + UInt32).size
<FromGitter> <bararchy> etc..
<FromGitter> <bararchy> sizeof ?
<FromGitter> <straight-shoota> sizeof(Foo)
<FromGitter> <bararchy> oh
<FromGitter> <bararchy> thanks @straight-shoota
<FromGitter> <aaronstillwell> Hey all. Does anyone know how to tell shards to use `git@...` rather than `https://...` when pulling dependencies from github?
<RX14> why?
<FromGitter> <bararchy> (i guess ssh keys SSO)
<RX14> so a private shard?
<FromGitter> <bararchy> yap
<RX14> you have to use the `git:` key
<FromGitter> <aaronstillwell> Because when using https, git is asking for username/password, rather than my ssh key
<FromGitter> <aaronstillwell> the shard isn't private
<FromGitter> <aaronstillwell> weirdly
<RX14> then you typoed the name :)
<FromGitter> <bararchy> yeha ^
<RX14> if it was private you could use `git: git@github.com:user/repo.git` instead of `github: user/repo`
<RX14> but it's not, so you shouldn't
<FromGitter> <aaronstillwell> thanks for the insights!
<RX14> did you typo? :)
<FromGitter> <aaronstillwell> No, sorry gitter just failed to send some of my messages
<FromGitter> <aaronstillwell> it's not my project, but it looks like the source of the dependency was changed
<FromGitter> <aaronstillwell> so I know the issue now
<RX14> ah i see
<crystal-gh> [crystal] RX14 closed pull request #5551: Add JSON support to UUID (master...uuid-json) https://git.io/vNkLO
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vx3tx
<crystal-gh> crystal/master 5d5c9ac Lachlan Dowding: Add JSON support to UUID (#5551)
<FromGitter> <bararchy> how can I translate Slice to UInt32 ?
<FromGitter> <bararchy> it seems I can't just "cast" it
<FromGitter> <bararchy> .to_unsafe.as maybe ?
<FromGitter> <bararchy> ```Slice(UInt8) # [1,0,0,0] ⏎ # I need to get the UInt32 it represents``` [https://gitter.im/crystal-lang/crystal?at=5aae815227c509a77477af14]
<FromGitter> <bararchy> Maybe this makes more sense as in question wise
<FromGitter> <bararchy> This works, is it the right way? ⏎ ⏎ ```slice.to_unsafe.as(Pointer(UInt32)).value.as(UInt32)``` [https://gitter.im/crystal-lang/crystal?at=5aae82b127c509a77477b3f8]
<Groogy> ugh this is waaaay too long to write D:
<travis-ci> crystal-lang/crystal#5d5c9ac (master - Add JSON support to UUID (#5551)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/355019483
<DeBot> https://github.com/crystal-lang/crystal/pull/5551 (Add JSON support to UUID)
<FromGitter> <r00ster91> `I cannot find a module or store with the name Number. `
<FromGitter> <faustinoaq> Groogy, maybe you can use `include Boleite::GUI` and then `container = Layout.new Layout::Style::Vertical`
return0e has quit [Read error: No route to host]
<Groogy> nah just made another initializer that takes a symbol
<FromGitter> <bararchy> Can't enum support something other then Int32 ?
<FromGitter> <straight-shoota> why?
<FromGitter> <bararchy> because I need to check UInt32 against it :)
<FromGitter> <picatz> @gdotdesign -- This is pretty awesome looking so far! https://www.mint-lang.com/
<FromGitter> <gdotdesign> @picatz thanks :)
return0e has joined #crystal-lang
<RX14> @bararchy `IO::ByteFormat::LittleEndian.decode(UInt32, bytes)`
<RX14> switch out little/big endian as required
ryan_ford has joined #crystal-lang
<RX14> or systemendian or networkendian
ryan_ford has quit [Ping timeout: 240 seconds]
ryan_ford has joined #crystal-lang
Yxhuvud has quit [Read error: Connection reset by peer]
Yxhuvud has joined #crystal-lang
<FromGitter> <bararchy> RX14 thanks :)
<FromGitter> <bararchy> It looks much better then the crazy pointerFu before
<RX14> lol
<RX14> and more portable
<RX14> works on little and big endian architecures
<RX14> ...if that's what you want
<RX14> and if not just use SystemEndian :)
<FromGitter> <bajro17> @faustinoaq thank you so much for share I like it :) it look something like vue.js
<FromGitter> <faustinoaq> Yeah πŸ‘
<FromGitter> <faustinoaq> ...with React and Types and Components and a bit of Elm πŸ˜‰
<FromGitter> <faustinoaq> Remember, Mint just created a gitter room: https://gitter.im/mint-lang/Lobby Take a look! πŸ˜„
<FromGitter> <bararchy> RX14 I'm parsing pcap files, so its System for the files, then Network for the actual packets
<RX14> ah cool yeah that makes sense
<FromGitter> <bararchy> Need to go back in time and kill relevant people who "invented this much better byte order method"
<RX14> eh
<FromGitter> <bararchy> Now just figure out how I convert UInt32 saddr and daddr to IP address strings
return0e has quit [Ping timeout: 240 seconds]
<That_Guy_Anon> whenever i hear Endianess i just get PTSD.
hightower3 has quit [Read error: Connection reset by peer]
hightower3 has joined #crystal-lang
<FromGitter> <t0nyandre> I'm a Vue kind of guy and I'm currently rewriting my GraphQL backend to Crystal (for my personal site/blog/CMS). I might just ditch Vue all together and use Mint! Go all out Crystal when I first rewrite everything πŸ‘ŒπŸ‘
<FromGitter> <gdotdesign> @t0nyandre I like your enthusiasm :D but I should to warn you that Mint is not even alpha yet, but if you do any feedback is welcome.
<RX14> @gdotdesign so... why crystal to write the compiler?
<RX14> currently got a crystal executable at 24.5GiB ram with no modifications
<FromGitter> <gdotdesign> <RX14> I have experience in Ruby, wanted something that is fast and compiles to a binary so either Go or Crystal
<RX14> ok, makes sense
<RX14> glad you chose crystal
<RX14> @gdotdesign what do you dislike most about the language currently
rohitpaulk has joined #crystal-lang
<FromGitter> <gdotdesign> there are only minor issues I have mostly about the type system like nil checking instance variables (they not work like regular variables)
<RX14> well there's not much we can do about that
<RX14> it's better to have to do `if var = @var` instead of get a segfault at runtime
<FromGitter> <gdotdesign> yeah that makes sense, it's just something that would be logical at first glance
<RX14> yeah it trips a lot of people up
<FromGitter> <gdotdesign> other than that I'm having a hard time coming up with anything so I guess I'm pretty happy with it :)
<RX14> but i'm fairly happy about the amount and utility of workarounds
<RX14> @gdotdesign that's great to hear
<FromGitter> <Sija> @aaronstillwell see https://github.com/crystal-lang/distribution-scripts/pull/6
<crystal-gh> [crystal] RX14 opened pull request #5839: Update CI distribution scripts (master...feature/gc-large-config) https://git.io/vx38P
<FromGitter> <straight-shoota> @gdotdesign you built an entire parser and compiler in Crystal and didn't run into any issues with type system, generics or similar?
<RX14> yeah I don't think i've written as much crystal code as you @gdotdesign
<FromGitter> <straight-shoota> I know I've hit quite a few rough edges when writing crinja
<RX14> probably designed the compiler the traditional way
<FromGitter> <bararchy> RX14 damn nice ! Thanks for helping all the large heap folks ;)
<RX14> @straight-shoota if you'
<RX14> ve written a compiler in C before you'll find it not that hard in crystal
<RX14> I'd guess that @gdotdesign just has more prior experience
rohitpaulk has quit [Ping timeout: 256 seconds]
<FromGitter> <straight-shoota> it's not that I had trouble designing how it should be but rather implementing it, because of some glitches in Crystal
<RX14> wellawhat kind of glitches?
<RX14> a newcomer is less likely to use all the shiny parts of the type system so they may hit less bugs
<FromGitter> <straight-shoota> for example #4147 #4151
<DeBot> https://github.com/crystal-lang/crystal/issues/4147 (Inconsistent error with initialization of instance variable) | https://github.com/crystal-lang/crystal/issues/4151 (Compiler does not recognize an uninitialized instance variable when a constructor from a superclass is involved)
<FromGitter> <straight-shoota> I started with crinja to get familiar with the language. So maybe I dove in pretty fast :D
<FromGitter> <faustinoaq> https://twitter.com/wycats/status/973761496277704704 ⏎ ⏎ ^ StackOverflow survey results: Windows is the primary OS for most developers πŸ˜…
That_Guy_Anon has quit [Remote host closed the connection]
moei has quit [Quit: Leaving...]
<FromGitter> <gdotdesign> @straight-shoota I've built the parser-type-checker-formatter-compiler from scratch it's really not that difficult. There are no high level types just a Node and the other nodes that inherited from that
<FromGitter> <gdotdesign> <RX14> I didn't have any prior experience in parsers / compilers
ryan_ford has quit [Quit: WeeChat 1.4]
<FromGitter> <faustinoaq> @gdotdesign Is flang (https://github.com/gdotdesign/flang) related to Mint in somehow?
return0e has joined #crystal-lang
<FromGitter> <gdotdesign> I've been playing with the idea of creating a language for the front-end web and I've been working on the concept in many forms one was flang
<FromGitter> <t0nyandre> @gdotdesign haha.. well, you can look at me as some kind of pre-alpha tester then πŸ˜‚ I mean.. I like new languages and I like to learn new way of writing code πŸ˜„ It's all about problem solving - why not have fun while doing it? πŸ˜„
<FromGitter> <gdotdesign> :D great
<FromGitter> <t0nyandre> And I HATE Gitter on Android. I have to kill the process and reopen it to get new messages written in the channel even if you @mention me!
<RX14> use irc ;)
<FromGitter> <t0nyandre> @faustinoaq haha.. I actually had to uninstall Windows from all my computers and laptops because I just can't work in Windows environment 😟 I have W10 as dual boot with Arch on my stationary just because I like playing Fortnite once every weekend πŸ˜‚
<t0nyandre> Ah, finally .. IRC :)
alex`` has quit [Quit: WeeChat 2.0.1]
moei has joined #crystal-lang
faustinoaq has joined #crystal-lang
<RX14> t0nyandre, you can use irc on your phone you know
<faustinoaq> Hi, someone knows if is possible to download crystal docs (https://crystal-lang.org/docs/) as PDF ?
<faustinoaq> I tried to search it on gitbook.io but seems isn't available
<oprypin> faustinoaq, http://pryp.in/crystal/
<RX14> wow cool
<faustinoaq> RX14 and oprypin Thank you!
<oprypin> faustinoaq, just updated it as well
<faustinoaq> oprypin, Oh, nice :)
<t0nyandre> RX14, I should try it out :)
<RX14> it's made by a friend of a friend and it's by far the best irc app for android
<RX14> and if you use ios then idk
<t0nyandre> I'm no Apple user :) Linux and Android for me, sir :) So thanks. I will check it out ;)
<FromGitter> <Jens0512> I don't know much about the files built by the crystal compiler (the executables), is there some kind of an identifier that marks a file as a crystal binary file? I mean, how can I check if a file is a crystal binary (executable)?
<t0nyandre> Have you used scss-mode inside spacemacs before btw? I'm trying to change the output directory of my compiled .scss files but they keep on getting written inside the same directory as the .scss files :-O
<FromGitter> <Jens0512> (Please don't answer 'all files are binary', you know what i mean)
<t0nyandre> I have asked over at the spacemacs channel, but just a long shot :p
<oprypin> Jens0512, it's just good old ELF. why do you think Crystal executables need to be special?
<oprypin> i'm sure there's some roundabout heuristic to find out if the executable happens to be produced by the Crystal compiler
<oprypin> Jens0512, one would be `strings executable_file | grep Crystal::`
<oprypin> of course someone could create a file that contains "Crystal::" intentionally to fool this check
<oprypin> and that's true for any heuristic, just that with this one it's obvious
<FromGitter> <Jens0512> Ok, thanks for answer, but 'ELF' Tells me nothing, can you be a bit more specific so I can search it up?
<FromGitter> <Jens0512> Thanks!
<FromGitter> <Jens0512> None of my attempts at `strings executable_file | grep -i crystal` have contained `Crystal::` :/
<FromGitter> <Jens0512> `CRYSTAL_CALLSTACK_FULL_INFO` Is the string I find most occurring
<oprypin> maybe release ones are different
<FromGitter> <Jens0512> I'll test
<FromGitter> <Jens0512> Building with release didn't contain it either
<FromGitter> <Jens0512> Might be that im on osx?
<FromGitter> <Jens0512> Dunno
<FromGitter> <faustinoaq> Try `hexdump -C file | less` and see if you can find something useful πŸ˜‰
faustinoaq has quit [Quit: IRC client terminated!]
alex`` has joined #crystal-lang
<FromGitter> <polypus74> any good libs for binary protocol packing/unpacking?
<FromGitter> <polypus74> what editor/ide has the best support for crystal?
<FromGitter> <Jens0512> The most useful thing I have found so far is that AWAVAUA appears all the time πŸ˜“
<FromGitter> <Jens0512> In other words, not much
<FromGitter> <faustinoaq> > any good libs for binary protocol packing/unpacking? ⏎ ⏎ @Jens0512 Maybe you can use Crystal itself, there is some nice modules in stdlib ⏎ ⏎ > what editor/ide has the best support for crystal? ... [https://gitter.im/crystal-lang/crystal?at=5aaed21f458cbde5574c34f6]
<FromGitter> <faustinoaq> Vim, Emacs, Sublime, Atom and VCode are the most used
<FromGitter> <Jens0512> `hexdump -C file | grep -i crystal` however, yielded much more favorable results
<FromGitter> <faustinoaq> πŸ‘
<FromGitter> <Jens0512> a search in less would also have worked i guess πŸ˜… :
<FromGitter> <faustinoaq> Yep
<FromGitter> <Jens0512> Thanks :D
<FromGitter> <faustinoaq> You are welcome πŸ˜„
<FromGitter> <polypus74> thanks guys. emacs vs vscode, i use both, which is further along?
That_Guy_Anon has joined #crystal-lang
<FromGitter> <Jens0512> Some great work in scry primarily aimed at vscode is currently going on
<FromGitter> <faustinoaq> ^ Looks like VSCode is the most used in those days πŸ˜…
<FromGitter> <faustinoaq> > Some great work in scry primarily aimed at vscode is currently going on ⏎ ⏎ Yeah, Any editor, Any IDE Take a look: https://github.com/crystal-lang-tools/scry
<FromGitter> <faustinoaq> LSP page as well: https://microsoft.github.io/language-server-protocol/
<FromGitter> <polypus74> cool thx, will have a look at scry
<FromGitter> <polypus74> how is immutability handled if at all in crystal?
<t0nyandre> @polypus74, I have been using vscode for ages. For Node.js developement and Golang but I changed to Spacemacs yesterday and I have to say that I really enjoy emacs more than vscode :)
<t0nyandre> Just my 2 cents
<FromGitter> <faustinoaq> Nice, I used to use emacs, I'll give a try again πŸ˜„ ⏎ ⏎ > how is immutability handled if at all in crystal? ⏎ ⏎ @polypus74 Well, crystal has some inmutable structures like Tuple, NamedTuple, struct and record and StaticArray, also strings are inmutable by default. [https://gitter.im/crystal-lang/crystal?at=5aaed5fa35dd17022e73bdec]
ashirase has joined #crystal-lang
That_Guy_Anon1 has joined #crystal-lang
<FromGitter> <polypus74> @faustinoaq , @t0nyandre , thanks
That_Guy_Anon has quit [Read error: Connection reset by peer]
<FromGitter> <Jens0512> Structs are immutable?
<FromGitter> <Jens0512> πŸ‘€ My definition of immutable is probably wrong then πŸ˜“
<FromGitter> <polypus74> looking at `alias` and it seems that you can't pass type parameters to it, ie: alias A(T) = Array(Pointer(T)). is this by design, is there some way of doing this? is this a temporary limitation? sorry for barrage of questions, first hour with crystal here
<FromGitter> <Jens0512> I think you can use a macro? Although I am not so sure if it'll work in type grammar
<FromGitter> <Jens0512> Actually, thinking about it, of course that doesn't work
remix2000 has joined #crystal-lang
<FromGitter> <Jens0512> Oh, actually, it does
<FromGitter> <Jens0512> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5aaed8f5f3f6d24c688c60b5]
<remix2000> Hello! Is it actually true that Amber is actually 3 times faster than Phoenix?
<FromGitter> <Jens0512> I know little about phoenix, but I'd assume *more* than 3 times
<FromGitter> <ezrast> structs and StaticArrays are mutable
<FromGitter> <ezrast> it's just discouraged
ashirase has quit [Quit: ZNC - http://znc.in]
ashirase has joined #crystal-lang
ashirase has quit [Client Quit]
<RX14> the answer is that you definine your immutability yourself
<RX14> immutability is just a function of the accessibility of methods on the object that set instance variables
<RX14> there are immutable things in the stdlib
<RX14> but that's just because they're designed and implemented that way
<RX14> so you can do whatever you want in crystal
<RX14> @polypus74
<remix2000> Jens0512, that's just unbelivable... What are the requirements for server?
<RX14> it depends what you mean by performance
<remix2000> (I mean: is it much lighter than Rails?)
<RX14> it'll run in 1MiB of ram
<RX14> ok maybe 5
<RX14> unless you do something stupid
<remix2000> RX14, requests per second to be precise
<remix2000> and of course, stability
<RX14> https://www.techempower.com/benchmarks/#section=data-r15&hw=ph&test=json&l=hjsbgf remix2000
<RX14> and I trust the crystal-radix data far more than the other 3 crystal results
<RX14> phoenix excells at stability, phoenix will be more stable
<RX14> the question is is crystal stable enough
alex`` has quit [Quit: WeeChat 2.0.1]
<oprypin> polypus74, check out https://github.com/Papierkorb/cannon for binary protocol
<remix2000> RX14, so crystal isn't production-ready yet?
<RX14> ...no
<RX14> you can use it in production
<RX14> people do
ashirase has joined #crystal-lang
<RX14> I do
<RX14> but we don't recommend it
<RX14> the question is if you ignore our advice
<RX14> i'd use crystal enough personally to know my own answer to whether to use it in production
That_Guy_Anon1 has quit [Remote host closed the connection]
That_Guy_Anon1 has joined #crystal-lang
<FromGitter> <faustinoaq> RX14, nice answer πŸ‘ ⏎ ⏎ remix2000, yeah, crystal isn't stable yet, so you need to be aware of breaking changes and other things. ⏎ ⏎ On amber we try to make it the most stable possible that crystal allow us, sometimes things fail (shards, new api, bugs) and we have to do some fixes and release a new version. ... [https://gitter.im/crystal-lang/crystal?at=5aaee44fe4d1c6360414ad3e]
<RX14> don't think thats what remix2000 meant by stability
<RX14> but i could be wrong
<FromGitter> <straight-shoota> a quick reminder for everyone following crystal-lang on stack-overflow: good questions and answers should receive upvotes =) This helps discoverability and visibility of these questions
<FromGitter> <polypus74> thanks all
<FromGitter> <ezrast> If I wanted to start understanding the current problems with generic inheritance, where in the compiler would I look?
<FromGitter> <faustinoaq> @ezrast I suggest to start with documentation https://crystal-lang.org/docs/syntax_and_semantics/inheritance.html ⏎ ⏎ Then you can search on crystal issues: https://github.com/crystal-lang/crystal/issues
<FromGitter> <ezrast> Sorry, what I mean is, I'm aware that generic inheritance is broken, and would like a starting point for looking at the compiler code to understand why and how it might be fixed.
commavir has quit [Remote host closed the connection]
commavir has joined #crystal-lang
<FromGitter> <faustinoaq> Then some more experienced crystal developers should answer your question πŸ˜…
<FromGitter> <faustinoaq> ^ RX14 @asterite
<FromGitter> <straight-shoota> @ezrast I would start looking at relevant issues, there are some with great explanations about the inner details
<FromGitter> <faustinoaq> Hey community someone knows if is possible to dump process memory to a file and load it again to a object with Same type? Like Ruby Marshaling does
<FromGitter> <straight-shoota> can't remember exactly about this topic though
<FromGitter> <faustinoaq> I remember there is some low level stuff in C to dump structs to a file and load it again
<FromGitter> <straight-shoota> https://github.com/Papierkorb/cannon can do it
<RX14> why would you want to
<RX14> whats the point
<RX14> just define a serialization format
<FromGitter> <straight-shoota> that's usually better
oetzguer has joined #crystal-lang
straight-shoota has joined #crystal-lang
<FromGitter> <straight-shoota> RX14 the channel message needs a version bump =)
<RX14> 0.24.2 hardly counts :)
oetzguer has quit [Client Quit]
<FromGitter> <straight-shoota> true^^
ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.2 | 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> <faustinoaq> @straight-shoota Thank you! πŸ‘ ⏎ ⏎ > whats the point ⏎ > just define a serialization format ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5aaef134e4ff28713a493f94]
moei has quit [Read error: Connection reset by peer]
moei has joined #crystal-lang
<FromGitter> <bajro17> I stack with creating shard
straight-shoota has quit [Read error: Connection reset by peer]
<FromGitter> <bajro17> Crystal::2fa
<FromGitter> <bajro17> invalid float suffix
straight-shoota has joined #crystal-lang
<FromGitter> <bajro17> is it because name or problem is something else?
That_Guy_Anon1 has quit [Quit: Leaving]
<FromGitter> <bajro17> I fix it
<FromGitter> <bajro17> this happen because of name
<FromGitter> <bajro17> can anyone help me rewrite one func from golang to crystal
<FromGitter> <bajro17> just to I know it for start how to do it correct way
<FromGitter> <bajro17> this is fun:
<FromGitter> <bajro17> func toBytes(value int64) []byte { ⏎ var result []byte ⏎ mask := int64(0xFF) ⏎ shifts := [8]uint16{56, 48, 40, 32, 24, 16, 8, 0} ⏎ for _, shift := range shifts { ... [https://gitter.im/crystal-lang/crystal?at=5aaef9e127c509a774799909]