<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:
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>
<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>
<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>
<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.
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> 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 π β¨
<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
<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 π
<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>
<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
<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
<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
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
<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
<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> 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> > 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>
<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]
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>
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>
<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