<FromGitter>
<picatz> Something like that would be a way to compose something like what you'd like / the require being simulated with just the module being required, essentially.
<FromGitter>
<picatz> Does that make sense?
<FromGitter>
<cevarief> Ah alright
<FromGitter>
<cevarief> make sense
<FromGitter>
<picatz> 👍 cool beans
<FromGitter>
<cevarief> thank you
<FromGitter>
<picatz> anytime ( as long as I can actually help, that is 😅 )
ShalokShalom has joined #crystal-lang
<FromGitter>
<ShalokShalom> someone already thought about a Ruby transpiler?
<FromGitter>
<ShalokShalom> would help to bring Ruby projects to Crystal
<FromGitter>
<ShalokShalom> full libs support
<FromGitter>
<picatz> I'm sure it'd be pretty tricky if not a bit impossible. Though, maybe I'm wrong. I dunno.
<wmoxam>
The problem is types, and metaprogramming
<wmoxam>
I am interested in crystal transpilers though
<wmoxam>
something like jsx for gui stuff
<Papierkorb>
cevarief, see the included hook
<Papierkorb>
ShalokShalom, even if doable, I'm not sure if that'd be desirable. Crystal ain't Ruby. Some patterns just don't translate well
<Papierkorb>
The syntax of both languages may be (deliberatly) similar, but you're still jumping from dynamic typing to static typing. That alone renders many design patterns useless (or not doable, like using `send(:foo)`), and makes other patterns possible (Like using proper method overloading)
<FromGitter>
<picatz> Crystal's method overloading is pretty cool 👍
snsei_ has quit [Remote host closed the connection]
sz0 has quit [Quit: Connection closed for inactivity]
snsei has joined #crystal-lang
<FromGitter>
<cevarief> @picatz is it possible to include module X inside a class?
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
snsei has quit [Remote host closed the connection]
<FromGitter>
<codenoid> hi, Where the location of the crystal folder on OS X ?
snsei has joined #crystal-lang
<FromGitter>
<codenoid> o, `$ brew info crystal-lang`
snsei has quit [Remote host closed the connection]
<FromGitter>
<cevarief> @picatz Solved. I have to use extend rather than include to avoid instantiating class. AnotherClass.hello.
<FromGitter>
<fridgerator> Method overloading <3
<ShalokShalom>
Papierkorb: how does Bucklescript this? Nim, Kotlin, Scala and all the others who compile from static typed languages into a dynamic one?
<ShalokShalom>
wmoxam: hi there. how did you solve the issues with your port? you named issues with cases where hashes are the primary method of passing data around. did you come them by?
<ShalokShalom>
the result can be something like 'interpret Crystal and compile Ruby', so one stack that works for both. :)
Disrecollection has joined #crystal-lang
<ShalokShalom>
Papierkorb: What do you mean with: Sub-classing C++/Qt classes - Overriding virtual C++ methods
<ShalokShalom>
I mean its clear enough for sure, i am simply a beginner. :)
maxpert has joined #crystal-lang
maxpert has quit [Remote host closed the connection]
Disrecollection has quit [Quit: Leaving.]
<FromGitter>
<mgarciaisaia> What dynamic languages on top of the JVM do is to, well, target the JVM. It may be compared(ish) with creating another language that targets the LLVM and call it a dynamic crystal
<FromGitter>
<cevarief> Using private keyword. thanks <z64> 👌
<z64>
no problem :)
<FromGitter>
<sdogruyol> thanks @bararchy :)
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
renovo has joined #crystal-lang
<Papierkorb>
ShalokShalom, it allows you to sub-class C++ classes from Crystal, and also to override (reimplement) C++ virtual methods (Which are the only kind of method overridable in C++)
<FromGitter>
<cevarief> In module, anything like initialize or class constructor?
<z64>
no ; modules cannot be instanced
<z64>
they are meant to act as namespaces and containers for methods to be mixed in to other classes via `include` or `extend`
<FromGitter>
<cevarief> I should create a class or can it be used @@ in module?
<z64>
you can use them in a module, yes
<FromGitter>
<cevarief> great
renovo has quit []
<FromGitter>
<schoening> Oh. Float64 is the same as JavaScripts number type? :D
<Papierkorb>
if your JS engine defines its number type as 64bit floating point type, yes
<FromGitter>
<schoening> I think they have to? I think thats defined in the standart?
bjz has joined #crystal-lang
<FromGitter>
<schoening> I havent read it tho. I only got my info from mozilla developer network, and the number type there and crystals float64 both pointed to the same wiki link :p
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Papierkorb>
And master-ready-to-use should work now™ without clang development stuff, you only require Qt libs+headers
<FromGitter>
<codenoid> are you working on linux os @Papierkorb ?
<Papierkorb>
codenoid, ArchLinux, yes
<FromGitter>
<ShalokShalom> So ready for the Qt Wiki page?
<Papierkorb>
Well, it's not prod ready. Next to weird crashes in some places (Which may have been fixed by recent bindgen updates), many crucial widgets are missing
<FromGitter>
<ShalokShalom> did you spend a look on the generic libraries i shared with you?
<Papierkorb>
I'll jump from TechPreview to Beta, and at that point, it'll be a "prod ready but it may eat your cat" state like Crystal is in
<Papierkorb>
I didn't ShalokShalom, didn't see how much help it would get me considering that 99% of the Qt bindings and wrappers are auto-generated already
<Papierkorb>
Even QML should feel right at home with probably a few custom converters here and there
<Papierkorb>
ShalokShalom, or does it do something more than essentially providing a C wrapper?
<FromGitter>
<ShalokShalom> I simply detect them at my evaluation for a Elixir binding, my experience as developer is currently still in its pre-alpha ;)
maxpert has joined #crystal-lang
<FromGitter>
<bararchy> Papierkrob, why MPL license though ?
<FromGitter>
<ShalokShalom> Its already in usage for 3 different languages; Nim, D and Rust.
<FromGitter>
<ShalokShalom> And are you interested into KDE bindings as well? Like for Kirigami, k18n and other stuff, that helps qt development?
<FromGitter>
<ShalokShalom> They are Tier1, so without any other KDE bindings required. :)
<Papierkorb>
bararchy I don't like MIT. I only request that people using it 1) contribute *to their users* if they make changes which is unlikely they have to 2) To note somewhere in their distributed product that they're using my bindings and where to acquire them. I'm giving you access to a huge framework, most likely enabling you do your project in the first place - All I ask for is that little recognition as payment. Sounds fair to me.
<Papierkorb>
ShalokShalom, in the long term, sure
<FromGitter>
<ShalokShalom> fine ^-^
<FromGitter>
<ShalokShalom> Go developer the-recipe started already as well with them - next to C++ is there any other KDE binding you know of?
<FromGitter>
<bararchy> Papierkorb I'm not against it, just wondering, I usually use MIT, my thinkning is that If I want to create an Opensource and free code, I should not bind my users to any "rules" regarding it, else, just make it free as in beer , But it's fine either way, I get your reasoning
<FromGitter>
<ShalokShalom> CC Zero is also an option
ar1a has quit [Quit: WeeChat 1.9]
<Papierkorb>
codenoid, make sure you're using the master-ready-to-use branch in your shard.yml, and then to rerun `crystal deps`. If it still doesn't work afterwards, please gist your shard.yml
<Papierkorb>
Please try with `crystal deps`, not `shards`
<Papierkorb>
They don't seem to be in sync
<FromGitter>
<codenoid> same
<FromGitter>
<codenoid> same result, btw when i use master, i got like `post, ext,`, etc process
<Papierkorb>
the `master` branch is for development, it can't be used right away (this is intended). That's what the X-ready-to-use branch is for
<FromGitter>
<bararchy> btw, `crystal deps update` is the command to use, I think .. I remmber something like that when deps will only install but wont update
<Papierkorb>
codenoid, the commit hash in your output indicates you're on master. that won't work. Make sure you're at the HEAD of master-ready-to-use.
<FromGitter>
<LuckyChicken91_twitter> is `loop` faster than `while true`?
<Papierkorb>
Maybe even force a full update by removing .shards/ and lib/ in your project dir
<Papierkorb>
The current build system relies entirely on Linux standard paths. I don't have a Mac to even begin testing.
<Papierkorb>
Also, it's Qt5, *not* Qt4
<FromGitter>
<codenoid> ok ^^
<FromGitter>
<bararchy> Papierkorb and you need QT 5 and up no ?
<FromGitter>
<bararchy> It seems @codenoid is using 4.8
<Papierkorb>
It's baffling that OS X doesn't even ship with a usable `readlink` binary.
<FromGitter>
<bararchy> Oh nvm
<FromGitter>
<LuckyChicken91_twitter> is `loop` faster than `while true`?
<Papierkorb>
bararchy, Yep, Qt5. And we're currently at Qt5.9, so it might be that qt5.cr will switch on to Qt6 before the "final" release
<FromGitter>
<bararchy> @LuckyChicken91_twitter Not sure, but I know that it's a better thing to use loop do instead of while true
<FromGitter>
<bararchy> Maybe while true will check if true is still true every iteration ?
<Papierkorb>
A major release of Qt happens every 4-6 years, so I guess it makes more sense on the long run to get most users over the the latest before that point. Though a qt5 branch will stick around, as many distributions just love to ship with super outdated Qt libs >_>
<Papierkorb>
codenoid, do you have Qt4 and/or Qt5 dev files installed?
<FromGitter>
<codenoid> i have no qt, :O , *qt5 installation process
<FromGitter>
<ShalokShalom> 'as many distributions just love to ship with super outdated Qt libs >_>'
<FromGitter>
<ShalokShalom> Our distro is on stable Plasma5 without any KDE SC 4 libs since about 2 1/2 years.
<maxpert>
I think I know the answer but, is there a way in crystal to explicitly hint a delete on some object? :P
<FromGitter>
<codenoid> Is there any other way of installing qt apart from its official site?
<Papierkorb>
It's not even funny anymore. Ask KDE the same question. Both Qt and KDE has to fight with numerous bug reports (partially angrily written) by people using Debian and such. Huge waste of everybodies time.
<Papierkorb>
maxpert: The compiler doesn't track object lifetime. Rust does.
<maxpert>
@Papierkorb hey :D you are here :D
<FromGitter>
<ShalokShalom> Papierkorb: They prefer such outdated distros.
<FromGitter>
<ShalokShalom> Especially Kubuntu and Neon.
<Papierkorb>
They? "They" have no idea what they're doing mostly.
<FromGitter>
<ShalokShalom> KDE release team, yeah.
<FromGitter>
<ShalokShalom> Hnn, who is the leader?
<Papierkorb>
The KDE releases for Arch have been fine for the most part
<FromGitter>
<ShalokShalom> yeah, Arch used PKGBUILDs from KaOS for the transition
<FromGitter>
<ShalokShalom> idk since how long they use their own, basement is still the same i guess
<FromGitter>
<ShalokShalom> Arch was afaik also the only binary distro, which accepted - at least after some months of rejection - that mixing the libaries of old and new KDE becomes unhealthy.
<FromGitter>
<ShalokShalom> Next to KaOS of course.
<Papierkorb>
With the switch to Plasma5, KDE4 was *gone*
<Papierkorb>
There was barely a grace period. May have been a few weeks at best.
<Papierkorb>
That doesn't include KDE4 apps of course, as many of those were not (or are still not) ported to Qt5/KDE5 yet
<FromGitter>
<ShalokShalom> The very most still packaged both together
<FromGitter>
<ShalokShalom> And a lot of the apps are ready since a much longer as the official release.
<FromGitter>
<ShalokShalom> Today, nearly everything is ported
<Papierkorb>
Ubuntu Artful (whatever version that is) seems to have Qt5.9.1, that might actually work
<FromGitter>
<ShalokShalom> 1) 10, the current
<FromGitter>
<codenoid> i'm in 16.04.
<FromGitter>
<codenoid> Tomorrow I'll try ;)
<FromGitter>
<ShalokShalom> I write a PKGBUILD for both
<FromGitter>
<ShalokShalom> Is there an AUR account on your side?
<FromGitter>
<codenoid> who ?
<FromGitter>
<ShalokShalom> Anybody who is willing to upload them to this place. ⏎ I mean, configured with all the blabla they let you drop PKGBUILD who dont build at all, so long as a super secure connection configured. ^-^
ShalokShalom has quit [Read error: Connection reset by peer]
<FromGitter>
<ShalokShalom> Papierkorb: Is the official name for the binding qt5.cr?
<FromGitter>
<bararchy> @ShalokShalom are you making a PKGBUILD for qt5.cr ?
<Papierkorb>
ShalokShalom, it is
<FromGitter>
<ShalokShalom> and the bindgen, yes
<FromGitter>
<ShalokShalom> thanks a lot
<FromGitter>
<bararchy> What's the point in making a PKGBUILD ? as in it suppose to come as a shard
<FromGitter>
<bararchy> or is it just for deps ?
<FromGitter>
<ShalokShalom> because i am used to 😄
<FromGitter>
<ShalokShalom> whenever i like to build something, is the direct way that one to a PKGBUILD for me
<FromGitter>
<ShalokShalom> since others can use it then as well
<FromGitter>
<ShalokShalom> i am simply not used to download and update packages with the inbuild package manager of programming languages
<FromGitter>
<ShalokShalom> and a lot of people will simply look on this place(s)
<FromGitter>
<ShalokShalom> Papierkorb: Why did you write a part in C++?
<Papierkorb>
Because Clang
<FromGitter>
<ShalokShalom> Ah i see.
<Papierkorb>
libclang-c is not up to standards, it barely touches the interesting parts of the API. So the original C++ API it was.
<Papierkorb>
I actually have a binding (not wrapper) generator written in Crystal using libclang-c, and while it worked to some degree, it wasn't pleasant
<Papierkorb>
I wasted more time fighting with the C API wrapper than anything. So, for anyone else, can't recommend.
<FromGitter>
<ShalokShalom> *notes that*
<FromGitter>
<ShalokShalom> in the bathtube, i thought about a LLVM IR <> Erlang VM transcompiler :D
<Papierkorb>
well that'd be "simply" a LLVM backend
maxpert has quit [Remote host closed the connection]
bjz has joined #crystal-lang
<FromGitter>
<LuckyChicken91_twitter> `Syntax error in crstal.cr:4: octal constants should be prefixed with 0o` ⏎ why is it not possible to have an int like `myint = 0137`?
<oprypin>
LuckyChicken91_twitter, other programming languages abused leading zero to mean something entirely different. to avoid confusion, modern programming language explicitly disallow number literals with leading zeros, because you can always just write the number without that zero and get the same effect
<FromGitter>
<G4BB3R> MYSQL = DB.open("mysql://root@localhost:3306/revistinha") ⏎ at_exit { MYSQL.close } ⏎ At production it gives an error: ⏎ "Client does not support authentication protocol requested by server; consider upgrading MySQL client (Exception)" [https://gitter.im/crystal-lang/crystal?at=59a30f70210ac26920c92109]
maxpert has quit [Remote host closed the connection]
<FromGitter>
<wwselleck> so I can do File.join("~", "dotfiles") and get back "~/dotfiles/~
xaxisx_ has quit [Quit: Leaving]
<FromGitter>
<elorest> yes.
<FromGitter>
<bitmappergit> yay
<FromGitter>
<bitmappergit> i got my first discord bot in crystal working
<FromGitter>
<crisward> congrats... done much crystal?
<FromGitter>
<bitmappergit> nope
<FromGitter>
<crisward> enjoying it so far?
<FromGitter>
<bitmappergit> yes
Papierkorb has quit [Ping timeout: 246 seconds]
Papierko- has joined #crystal-lang
<FromGitter>
<crisward> cool... so far not wore off for me...
<FromGitter>
<crisward> Seems I've been messing with it for a year now. Found a few bugs, but nothing terrible
<FromGitter>
<elorest> I love crystal and have been working with it extensively. Really need to find a 20 sided black glass polyhedron to sit next to my ruby.
<FromGitter>
<bitmappergit> btw
<FromGitter>
<bitmappergit> a 20 sided polyhedron is a isodecahedron
<FromGitter>
<crisward> @elorest for one of your dramatic avatars?
<FromGitter>
<crisward> Surely crystals are transparent? Though you get the diamond confusion...
<FromGitter>
<bitmappergit> i know
<FromGitter>
<bitmappergit> i said it was the closest i could find
<FromGitter>
<elorest> Yeah but the crystal logo is black obsidian… @bitmappergit Yeah that actually is really close to what I want… Probably the closest I’ve seen.
<FromGitter>
<elorest> I found an obsidian 20 sided die but it had numbers on it.
<FromGitter>
<wwselleck> ive been using crystal for like 2 days but love it so far
<FromGitter>
<wwselleck> only thing is the docs seem to assume u have a ruby background
<FromGitter>
<wwselleck> i have a working ruby knowledge, but come from JS/python/go mostly
<FromGitter>
<elorest> @wwselleck Ruby docs are really extensive at this point so if you can't solve something in crystal look it up in the ruby docs. And try to move the knowledge over.
<FromGitter>
<crisward> I spent a lot of googling things like "replace in ruby", which is gsub, which it is in crystal, so it does work, most of the time.
<FromGitter>
<crisward> Also from node background.
<FromGitter>
<elorest> It’s probably best for the community if we fix the docs in scenarios like that as well and send a PR.
<FromGitter>
<crisward> gsub is in the docs, it's just under strings. I could probably write a crystal for node devs post. Just have a feeling it may go on a bit, not sure where to start or end...
<FromGitter>
<elorest> Yeah definitely in the case of gsub and a lot of things I’ve finally found just at a place that I didn’t expect. In some cases they really need to be added though.
<Papierko->
Wtf is that. Oh great I broke either Crystal or LLVM.
<Papierko->
Looks like g++ and/or Crystal or LLVM doesn't agree on how to pass many structures (not pointers) at once.