ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.34.0 | 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> <oliviahandoko> confused why it doesnt output the "What is your next question?" until the conditiona
<FromGitter> <oliviahandoko> it only asks "What is your next question?" once
<FromGitter> <Blacksmoke16> Setting it to false
<FromGitter> <tenebrousedge> also do `break if question =~ /no/i`
<FromGitter> <j8r> 7x slower for auto iter
<FromGitter> <Blacksmoke16> `break if question.downcase == "no"`
<FromGitter> <tenebrousedge> eh, either way
<FromGitter> <Blacksmoke16> @oliviahandoko but you're setting `question_bool = false`, which it checked against in the `while` statement, is only true on one iteration so it stops
zorp has quit [Ping timeout: 250 seconds]
Dreamer3 has quit [Quit: Leaving...]
<FromGitter> <oliviahandoko> thank you!
ur5us has quit [Ping timeout: 240 seconds]
ur5us has joined #crystal-lang
deavmi has quit [Read error: Connection reset by peer]
deavmi has joined #crystal-lang
masterdonx2 has quit [Ping timeout: 256 seconds]
MasterdonX has joined #crystal-lang
<Andriamanitra> why doesn't this work and how can i make it work https://play.crystal-lang.org/#/r/8y7u
<FromGitter> <Blacksmoke16> You define a class variable but without a getter
<Andriamanitra> i tried adding getter variable and it didn't change anything
<FromGitter> <Blacksmoke16> `class_getter variable : String = "module variable"`
<Andriamanitra> oh, it needs to be "class_"
<Andriamanitra> that's weird i could've sworn i have written just "getter" before and it worked
<FromGitter> <Blacksmoke16> Correct, otherwise it defines a instance variable and getter
<Andriamanitra> ooh, thanks i get it now
<FromGitter> <user45789> hi
<FromGitter> <Blacksmoke16> Hi
disruptek has left #crystal-lang [#crystal-lang]
ur5us has quit [Ping timeout: 240 seconds]
<Andriamanitra> what does indirect initialization mean
<Andriamanitra> I'm getting Error: instance variable '@targets' of Numbersgame::Game was not initialized directly in all of the 'initialize' methods, rendering it nilable. Indirect initialization is not supported.
<Andriamanitra> but i do have @targets = self.get_targets in my initialize method
<FromGitter> <Blacksmoke16> Can you make a playground link?
<Andriamanitra> i can try, my project is using multiple files and dependencies and getting long-ish so i probably can't directly paste what i have
<FromGitter> <Blacksmoke16> Just make sure you're assigning targets in all initializers
<Andriamanitra> i only have one
<FromGitter> <Blacksmoke16> Also try setting it directly versus based on return value of a method
<FromGitter> <Blacksmoke16> That's probably why it's saying indirect
<Andriamanitra> is there maybe an implicit initialize method that takes no parameters?
<Andriamanitra> nope, that didn't fix it
<FromGitter> <Blacksmoke16> Hmm
<Andriamanitra> it works in playground :|
<FromGitter> <Blacksmoke16> Well you know it's the game class
<FromGitter> <user45789> could it be that maybe self.get_targets return nothing
<FromGitter> <Blacksmoke16> Is it a big class? A gist of it would probably be enough
<Andriamanitra> whenever i try to come up with a simpler version of what i have it just works
<FromGitter> <Blacksmoke16> Usually how it goes :p
<Andriamanitra> i'm so lost here :D i swear i had this exact same code in the playground already and that time it worked https://play.crystal-lang.org/#/r/8y97
<Andriamanitra> but now i'm at least reproducing the error, progress is happening
<FromGitter> <Blacksmoke16> yea, just dont use `self.`
<FromGitter> <Blacksmoke16> but really unless that `get_targets` method should be part of the public API, just do that within the constructor
<Andriamanitra> oh right, removing "self." fixes it in the playground but not in my own code
<Andriamanitra> also changing it to @targets = [1,2,3] fixes it in playground but not in my own code
<FromGitter> <Blacksmoke16> are you sure you dont have any other place/methods that is setting it?
<FromGitter> <Blacksmoke16> or if possible, a gist of the class?
<Andriamanitra> i tried commenting out every other use of the variable besides those two with no luck
<FromGitter> <Blacksmoke16> yea without seeing the code i dont have any suggestions, im sure its a similar case to that playground link tho
<FromGitter> <kazzkiq> Did anybody else experienced slow installation on macOS?
<FromGitter> <kazzkiq> I just ran `brew upgrade crystal` and it's working for about 10min now
<FromGitter> <Blacksmoke16> :thinking: is it stuck on something?
<FromGitter> <Blacksmoke16> depending on your internet speed, it could just be updating LLVM, which is a not small
<FromGitter> <kazzkiq> nope, in the toolbar it keep swiching between clang/ruby stuff
<FromGitter> <kazzkiq> and CPU is screaming here
<FromGitter> <Blacksmoke16> i recall having something similar happen to me
<FromGitter> <kazzkiq> And I have high-end hardware, don't remember older versions taking that long
<FromGitter> <kazzkiq> ```code paste, see link``` ⏎ ⏎ those are the last comands in the console [https://gitter.im/crystal-lang/crystal?at=5ea3bd021eb8bd3978f39cd3]
<FromGitter> <Blacksmoke16> xcode up to date?
<FromGitter> <Blacksmoke16> id try uninstalling it first, then try reinstall
<FromGitter> <kazzkiq> just did that. 1st try was upgrade, then uninstall and fully new install
<FromGitter> <kazzkiq> stuck in the same point in both cases
<FromGitter> <kazzkiq> I guess I
<FromGitter> <kazzkiq> I guess I'll leave it running by night just to confirm if it got stuck or just something really slow going by
<FromGitter> <Blacksmoke16> naw its trying to build something it shouldnt
<FromGitter> <Blacksmoke16> `xcode-select --install`
<FromGitter> <Blacksmoke16> try that
<FromGitter> <kazzkiq> found some updates
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <Blacksmoke16> did you update to Catalina recently?
<FromGitter> <kazzkiq> will try again after that and let you know if it worked
<FromGitter> <Blacksmoke16> 👍 pretty sure that will do it, iirc thats what i had to do as well
<FromGitter> <kazzkiq> I've upgraded to Catalina recently but had no further updates added
<Andriamanitra> Blacksmoke16: alright here's the full code https://github.com/Andriamanitra/numbersgame/blob/master/src/numbersgame.cr
<Andriamanitra> i'm terribly lost with this issue
<FromGitter> <Blacksmoke16> ` @numbers = self.get_numbers(@level)`
<FromGitter> <Blacksmoke16> you're passing an ivar to a method that sets another ivar
<FromGitter> <ImAHopelessDev_gitlab> i love eight balls
<Andriamanitra> uh, what is ivar?
<FromGitter> <Blacksmoke16> thats not something you can do because it would be possible for that method to use an ivar that wasnt initialized yet
<FromGitter> <Blacksmoke16> instance variable
<Andriamanitra> hmm i see
<FromGitter> <grkek> @ImAHopelessDev_gitlab bro thats cringe
<Andriamanitra> weird that the compiler kept complaining about @targets when @numbers was actually the problem
<FromGitter> <Blacksmoke16> true
ericm has joined #crystal-lang
<FromGitter> <ImAHopelessDev_gitlab> @grkek oops, meant the eight ball game in screenshot above
<FromGitter> <grkek> lol
<FromGitter> <grkek> Have you ever tried khinkali? @ImAHopelessDev_gitlab
_whitelogger has joined #crystal-lang
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
<oprypin> @grkek: u have some? gimme
_ht has joined #crystal-lang
alexherbo2 has joined #crystal-lang
<FromGitter> <ImAHopelessDev_gitlab> @grkek nope, what is it
zorp has joined #crystal-lang
<FromGitter> <grkek> Do ytou like khinkali oprypin?
<FromGitter> <grkek> its a yummy georgian dumpling
<FromGitter> <grkek> I am from Georgia and damn lots of ppl love Khinkali
<FromGitter> <grkek> you guys should try making it
<FromGitter> <grkek> there are tons of tutorials online
<oprypin> yea i like it
ur5us has joined #crystal-lang
yxhuvud has quit [Remote host closed the connection]
<FromGitter> <grkek> Aw wolderful
<FromGitter> <grkek> Visit Georgia someday I might cook you some khinkali m8
<FromGitter> <ImAHopelessDev_gitlab> trying new food is like trying a new programming language
<FromGitter> <grkek> Khinkali is like
<FromGitter> <grkek> crystal
<FromGitter> <grkek> yummy
<FromGitter> <grkek> and comfy
<FromGitter> <grkek> juicy af
<FromGitter> <j8r> it reminds asian food
<FromGitter> <user45789> hi
<FromGitter> <j8r> Hi user
<FromGitter> <j8r> the 45789th
<FromGitter> <user45789> =D
<FromGitter> <j8r> Your random picture is an happy smiley
<FromGitter> <j8r> quite uncommon
<FromGitter> <user45789> its github auto picture
<FromGitter> <j8r> fits you well btw
<FromGitter> <j8r> haha
<FromGitter> <user45789> yeah its quite a successfull system isn't it
<FromGitter> <user45789> do you use crystal with godot @j8r ?
<FromGitter> <j8r> I started @user45789
<FromGitter> <user45789> pretty cool
<FromGitter> <j8r> I stopped on the UDP communication between the godot client and the crystal server. I'm busy with an other project now
<FromGitter> <grkek> Does godot have crystal support?
<FromGitter> <j8r> it has GDNative, which brings supports to most languages
<FromGitter> <j8r> but we have to create bindings
<FromGitter> <grkek> hot af
<FromGitter> <j8r> there are already Python, Ruby and Nim
<FromGitter> <user45789> well u can use websockets too
<FromGitter> <j8r> Coding in C# or GDScript is fine for me, there are a lot more resources
<FromGitter> <user45789> so that u can compile ur game to webgl
<FromGitter> <grkek> I really want wasm for crystal
ur5us has quit [Ping timeout: 240 seconds]
<FromGitter> <user45789> for games ?
<FromGitter> <j8r> @user45789 yes, browser support would be great
<FromGitter> <j8r> I'm searching WebSocket vs UDP
<FromGitter> <j8r> TCP is not an option for multiplayer games
<FromGitter> <user45789> well with godot u can use websocket
<FromGitter> <user45789> and with crystal too
<FromGitter> <user45789> and u can export your godot game to webgl
travis-ci has joined #crystal-lang
travis-ci has left #crystal-lang [#crystal-lang]
<travis-ci> crystal-lang/crystal#b8bbd29 (master - Add JSON and YAML serialization to Path (#9156)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/679377262
<DeBot> https://github.com/crystal-lang/crystal/pull/9156 (Add JSON and YAML serialization to Path)
<FromGitter> <j8r> there is also WebRTC
<FromGitter> <user45789> u can also do a really cool thing
<FromGitter> <user45789> render ur 3d in crystal and send it trought websocket to a canvas
<FromGitter> <user45789> tunneling the inputs and mouse position too
<FromGitter> <j8r> I plan to send blocks/player position, then let the client render it
<FromGitter> <user45789> yeah its pretty easy u can get it done quickly
<FromGitter> <j8r> mouse position is not a big deal, it is just client camera. but XYZ is
<FromGitter> <j8r> not mentioning, if there is a mismatch between client and server for the position - not that easy to deal
<FromGitter> <j8r> because client <=> server has a latency
<FromGitter> <user45789> yep
<FromGitter> <user45789> u can interpolate
<FromGitter> <user45789> if u know the player direction and the latency
<FromGitter> <user45789> and the speed
<FromGitter> <j8r> right
<FromGitter> <user45789> really a facinating topic
<FromGitter> <j8r> you work on a game?
<FromGitter> <user45789> nope
<FromGitter> <user45789> when i discovered godot i did a scene with multiplayer websocket and gi probes to test it
<FromGitter> <j8r> nice :)
<FromGitter> <user45789> i remember the problem was when a client joined the camera switched to his
<FromGitter> <j8r> on a little side project, I'm working on a fully procedural work made with blocks (and pyramids)
<FromGitter> <user45789> cool
<FromGitter> <user45789> can u share some screenshots
<FromGitter> <j8r> For now, the is no much (because I still have to do the UDP client/server)
<FromGitter> <j8r> still, in Crystal, I was able to generate 20 millions blocks random in 30seconds using OpenSimplexNoise
<FromGitter> <j8r> looks promising
<FromGitter> <rishavs> thats fantastic
<FromGitter> <user45789> yeah i saw ur repository
<FromGitter> <rishavs> cray or crsfml?
<FromGitter> <j8r> The author was very friendly, I have taken the maintenance of the repo :)
<FromGitter> <j8r> @rishavs the client interface is in Godot/GDScript
<FromGitter> <j8r> because easy, lots of resources, portable
<FromGitter> <j8r> and Crystal as the back because portable is not as a big deal, and performance really matters
<FromGitter> <rishavs> I never could get into godot for some reason. large engines intimidate me. something like love2d/raylib is more my speed :D
<FromGitter> <user45789> i like raylib too, but godot is really easy
<FromGitter> <user45789> and more clear than unity
<FromGitter> <j8r> 3D is intimidating :$
<FromGitter> <rishavs> yeah. 3D gets worse when you start chaining tools together
<FromGitter> <j8r> Unfortunately, I will have to do my physics in Crystal
<FromGitter> <rishavs> only to find that the export of one doesnt works well with another
<FromGitter> <j8r> ha yes, I heard that
<FromGitter> <rishavs> Can't you use something like chipmunk for that?
<FromGitter> <user45789> do u mean blender and such
<FromGitter> <j8r> fortunately my game is entirely procedural :P
<FromGitter> <rishavs> not sure chimpunk has 3d support
<FromGitter> <rishavs> I am also working on a proc game. my plan is to have a grid of rooms and corridors. Each of which can have either an enemy, or another mini game mode in it. and the players traverses through them all
<FromGitter> <rishavs> only 2d though
<FromGitter> <rishavs> sort of a rougue-lite
<FromGitter> <j8r> I like this games :)
<FromGitter> <rishavs> I did some early experiments in nim, then settled on f# (i love union types). then @oprypin , did a lot of windows work and I ened up back here hoping to play with crystal yet again :D
<FromGitter> <rishavs> I really need to settle down on a single tool and get something done
<FromGitter> <user45789> turns out crystal is the most powerfull one
<FromGitter> <user45789> so friendly
<oprypin> oh wow i had no idea there was another language where Optional is implemented through a first-class union feature
<FromGitter> <j8r> @user45789 did you try Godot with C# on linux?
<FromGitter> <rishavs> Crystal is indeed my favorites language, but the more I use f#, i am liking it as well
<FromGitter> <user45789> not with c#
<FromGitter> <user45789> https://github.com/ysbaddaden/sdl.cr
<FromGitter> <rishavs> I hate c# with a passion. I can't deal with that much oop-ness :D
<FromGitter> <rishavs> I like my crystal with its mild dash of OOPness
<FromGitter> <j8r> Is there any physics library in Crystal (no graphics)
<FromGitter> <rishavs> @oprypin , f#'s type system is really amazing.
<oprypin> j8r, well yea chipmunk
<FromGitter> <rishavs> chipmunk. Its in Oleh's repo
<oprypin> 3d physics is such a can of worms. u basically cant do it
<FromGitter> <j8r> sorry yep 3D
<FromGitter> <user45789> well yes
<FromGitter> <user45789> there is =D
<FromGitter> <user45789> inside raylib
<FromGitter> <j8r> No 3D graphics lib :( ⏎ Does a Minecraft like game needs complex physics? I think it is feasible
<FromGitter> <straight-shoota> define complex physics
<FromGitter> <rishavs> do you really need a full blown physics engine for this?
<FromGitter> <rishavs> it looks like you just need good collision detection and gravity
<FromGitter> <straight-shoota> For minecraft probably not
<oprypin> ah it's true
<FromGitter> <j8r> @user45789 looks like 2D physics
<FromGitter> <user45789> theres a lot 3d collision functions in raylib
<FromGitter> <j8r> @rishavs yes that this
<FromGitter> <straight-shoota> The water dynamics don't look like very high-tech physics
<FromGitter> <j8r> @user45789 good to know, I keep it in mind in case I need it
<FromGitter> <rishavs> i am mostly talking out of my ass here, but afaik, water dynamics don't need much physics. its all shaders
<FromGitter> <user45789> you can even raycast to meshes
<FromGitter> <user45789> and access to raygui : https://gitlab.com/TeddyDD/cray-raygui
<FromGitter> <user45789> just have to remove the "," in the enums.cr
<FromGitter> <j8r> raylib looks sick, but Crystal has no Windows, mobile and browser support :/
<FromGitter> <user45789> they are working on it
<FromGitter> <j8r> yep I know
<FromGitter> <j8r> Godot is good for the client side
<FromGitter> <user45789> indeed
<FromGitter> <straight-shoota> @rishavs Water in minecraft actually flows, that's not shaders but physics. But it's very rudimentary. Just like the entire engine is just based on simple blocks :=
<FromGitter> <user45789> :D
<FromGitter> <j8r> oprypin: sick!
<FromGitter> <user45789> if u wanna go that road you can combine sfml with imgui, that guy made a binding https://github.com/andrewoconnor/crimgui
<FromGitter> <j8r> what I'd add, compared, minecraft is matter conservation
<FromGitter> <j8r> so no infinite water and farms, or blocks destroyed permanently
<FromGitter> <rishavs> Talking of windows, now that we have a crystal.exe, how about shards.exe? :3
<FromGitter> <grkek> oh my
<FromGitter> <rishavs> i think half of the crystal maintainers just groaned in unison....
<FromGitter> <grkek> yesss
<raz> i hate browsers
<FromGitter> <grkek> IIRC why?
yxhuvud has joined #crystal-lang
lanodan has quit [Quit: WeeChat 2.7.1]
<FromGitter> <codenoid> how things going folks
go|dfish has quit [*.net *.split]
justinmcp_ has quit [*.net *.split]
justinmcp has joined #crystal-lang
livcd has quit [Ping timeout: 250 seconds]
<Stephie> oprypin, I still dunno what to feel about #9043
<DeBot> https://github.com/crystal-lang/crystal/pull/9043 (Add Process.quote and fix shell usages in the compiler)
<Stephie> it almost feels like it should be a language feature somehow
<Stephie> i hate the idea of this being sprinkled around shell code all the time
<Stephie> and if you forget it, you have a security vulnerability
<Stephie> if the variable is attacker-controlled in any way
<Stephie> but there's no clean way to do that like in SQL
<oprypin> Stephie: uhh nobody says it has to be the final state
<Stephie> yeah, idk
<Stephie> i just don't know
<oprypin> it fixes vulnerabilities that we have now and even conveniently marks the places for future consideration
<oprypin> @rishavs: i literally have looked at shards.exe. the codebase is pretty bad, just unix shell commands everywhere
<oprypin> but probably good task for newcomers
<oprypin> not a small task tho
travis-ci has joined #crystal-lang
<travis-ci> crystal-lang/crystal#34c4be8 (master - Add binding to biginteger factorial in GMP (#9132)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/679435882
travis-ci has left #crystal-lang [#crystal-lang]
<DeBot> https://github.com/crystal-lang/crystal/pull/9132 (Add binding to biginteger factorial in GMP)
<yxhuvud> stephie: I agree. What would be really awesome would be something similar to how html-escaping of user supplied values work in rails, ie that people need to opt out of escaping, rather than opting in to it. I have never seen anyone do that with regards to shell escaping though
<FromGitter> <manveru> is there a way to use `case` in ECR?
<FromGitter> <ImAHopelessDev_gitlab> @rishavs nice! similar boat here, but i went with dlang instead of f#. really loving d
<FromGitter> <ImAHopelessDev_gitlab> i get the crystal vibe from dlang. clean syntax, great peformance
livcd has joined #crystal-lang
<FromGitter> <j8r> I'm gonna trust the client for most of things first, then implement anti cheat after
<FromGitter> <user45789> just wanna say that debian 10 buster is the easest distribution to get SFML 2.51 and crystal using APT straight out the box
<oprypin> user45789, i would argue that Arch is the easiest but whatever floats your boat
<oprypin> the latest debian was the one that had sfml 2.3 for like a year after 2.4 came out
<oprypin> and of course Arch has crystal in *official* repositories
<FromGitter> <user45789> didnt know
<FromGitter> <user45789> its kinda awesome
<oprypin> im actually using 14 GiB of RAM
<oprypin> 169 tabs in Firefox, VM with 4GiB and of course VS code (on both systems) to top it off. but dont judge, im just trying out VS code and it's not lookking good so far
<FromGitter> <user45789> lol
<FromGitter> <user45789> whats ur editor for coding
<oprypin> Kate
<oprypin> and it's really shit in terms of Crystal support
<FromGitter> <user45789> somebody need to make and editor just for crystal
<oprypin> pls no :s
<FromGitter> <user45789> maybe not xD
<FromGitter> <j8r> 169 tabs... omg
<FromGitter> <j8r> I tried Kate, but kept Geany because of easy basic Crystal support
<FromGitter> <j8r> I force myself to close things I don't use , otherwise it is a mess
<FromGitter> <j8r> in general, cleaning unnecessary data
<FromGitter> <j8r> D is neat, why does it have not much traction?
<FromGitter> <user45789> oprypin are you familiar in how to make crimgui work ?
<oprypin> no never looked at it
<oprypin> and likely never will xD
<FromGitter> <user45789> did u know to install sfml shard if i dont specify branch master i get Missing "v2.2.0:shard.yml" for "crsfml"
<FromGitter> <user45789> im not trying to open an issue it works
<oprypin> user45789, so use version: 2.5.1 according to that
<oprypin> user45789, this is not about opening an issue but an xplanation
<oprypin> thx @Blacksmoke16 i would've started really worrying
<FromGitter> <Blacksmoke16> np
<FromGitter> <user45789> its just on the github page its not specified that branch need to be mentioned in the shards yml
<FromGitter> <Blacksmoke16> if you dont specify a commit/branch/version it loads all versions to find the one that works with other dependencies
<FromGitter> <user45789> hooo
<FromGitter> <Blacksmoke16> thus it goes back thru previous releases, which you get that error since that one release doesnt have one
<FromGitter> <Blacksmoke16> w/o specifying it usually will use that latest
<oprypin> user45789, yea i actually meant to do that but forgot
<FromGitter> <user45789> well that explain why i cant get the crimgui to work
<FromGitter> <Blacksmoke16> but *really* would be a good habit to be explicit about versions and such
<FromGitter> <Blacksmoke16> then you dont run into things breaking all of a sudden etc
<FromGitter> <user45789> crimgui is looking for SFML 2.2.0
<FromGitter> <user45789> and i try to force it to use 2.5.1
<FromGitter> <Blacksmoke16> related https://github.com/crystal-lang/shards/issues/299
<FromGitter> <user45789> if i try to shard install with sfml branch:2.2 i get Missing "f9253349b25c1f0e01f5839b95c470f334e85d7c:shard.yml" for "crsfml"
<FromGitter> <j8r> @Blacksmoke16 there is the `shard.lock` for that
<FromGitter> <j8r> no need to pin in `shard.yml`
<oprypin> user45789, what the heck no you cant use 2.2
<oprypin> that's from times when shard.yml wasnt a thing
<FromGitter> <user45789> roger thanks
<oprypin> Blacksmoke16, i can't reproduce that issue with shards without version, what am i doing wrong
<FromGitter> <user45789> can i help u with some info
<oprypin> @user45789, shards --version
<FromGitter> <user45789> Shards 0.10.0 [4091ac5] (2020-04-06)
<FromGitter> <user45789> so i created a directory, cd into it, shards init, modify it with ⏎ dependencies: ⏎ crsfml: ⏎ ⏎ ```github: oprypin/crsfml``` [https://gitter.im/crystal-lang/crystal?at=5ea48f4a2bf9ef1269a3e900]
<FromGitter> <user45789> shards install
<FromGitter> <user45789> and it gives the Missing "v2.2.0:shard.yml" for "crsfml"
<oprypin> @user45789 yep! got it reproduced, thanks. Missing "v2.2.0:shard.yml" for "crsfml"
<oprypin> but yea it's nothing to do on my side
<FromGitter> <Blacksmoke16> @j8r you still should pin `shard.yml`, otherwise if they do a release and you do an update, you'll get that new version
<oprypin> this is specific to shards v0.10.0 only. previous release is good, next release will be good too
<FromGitter> <Blacksmoke16> `shard.lock` is for when you're installing
<FromGitter> <user45789> np thank to u for the lib ^^
<oprypin> @Blacksmoke16, @j8r, the truth is perhaps in the middle
<oprypin> https://shardbox.org/shards/crsfml suggests `version: ~> 2.5.1`, that's probably good
<FromGitter> <Blacksmoke16> im also not saying specific version
<FromGitter> <Blacksmoke16> yea, something like that is fine, assuming shard is following semver
<FromGitter> <Blacksmoke16> then you get bug fixes but are protected from breaking changes and such
<oprypin> my shard doesnt follow semver ;(
<FromGitter> <Blacksmoke16> rip
<FromGitter> <ImAHopelessDev_gitlab> @j8r i was wondering the same thing
ht_ has joined #crystal-lang
_ht has quit [Ping timeout: 260 seconds]
ht_ is now known as _ht
<FromGitter> <j8r> @Blacksmoke16 yep that's the principle
<FromGitter> <j8r> update all with `shards update`
<FromGitter> <j8r> If everything works, great. Otherwise, rollback the lock file and pin the version, or fix the code
<FromGitter> <j8r> pinning versions with not reasons means not having updates easily in the future, unless tracking every dependency with pinned versions regularly
skrzyp has quit [Remote host closed the connection]
skrzyp has joined #crystal-lang
<FromGitter> <ImAHopelessDev_gitlab> bought contacts on the 2nd. still stuck in chicago (i'm in washington state). tracking hasn't been updated since the 11th
<FromGitter> <ImAHopelessDev_gitlab> company said it's because of the "global pandemic"
<FromGitter> <asterite> girng that's off topic
<FromGitter> <asterite> talking about crystal lenses is fine though
Dreamer3 has joined #crystal-lang
<FromGitter> <ImAHopelessDev_gitlab> why are the lead devs merging PRs that hide modules behind namespaces
<FromGitter> <Blacksmoke16> because thats a good practice
<FromGitter> <Blacksmoke16> grouping related things
<FromGitter> <ImAHopelessDev_gitlab> no it isn't
<FromGitter> <Blacksmoke16> yes it is
<FromGitter> <ImAHopelessDev_gitlab> hiding it behind namespaces make it harder for the dev to find it on the docs, and second, more text to write
<FromGitter> <ImAHopelessDev_gitlab> which goes against crystal's syntax
<FromGitter> <ImAHopelessDev_gitlab> are you saying `require "SocketManagementFactory/socket"` is better than `require "socket"`?
<FromGitter> <Blacksmoke16> its not hiding, its grouping
<FromGitter> <Blacksmoke16> oh look all of the compression related modules are here in one place
<FromGitter> <Blacksmoke16> how helpful
<FromGitter> <ImAHopelessDev_gitlab> apply your "not hiding, it's grouping" logic to `socket` then
<FromGitter> <Blacksmoke16> where does that happen?
<FromGitter> <ImAHopelessDev_gitlab> we got UDPSocket, UNIXSocket, TCPServer, UNIXServer, Socket
<FromGitter> <ImAHopelessDev_gitlab> want to hide all those behind a namespace too?
<FromGitter> <Blacksmoke16> arguably prob will at some poit
<FromGitter> <ImAHopelessDev_gitlab> yikes
<FromGitter> <ImAHopelessDev_gitlab> terrible idea
<FromGitter> <Blacksmoke16> k
<FromGitter> <Blacksmoke16> `compress/gzip` is not that much harder than just `gzip`, esp considering these arent really used often
<FromGitter> <ImAHopelessDev_gitlab> "slick as ruby, but wait, write colons and access that module with a namespace!" not so slick anymore.
<FromGitter> <Blacksmoke16> plus im pretty sure you still could just do `require "gzip"`
<FromGitter> <Blacksmoke16> nvm, its there but deprecated
<FromGitter> <Blacksmoke16> you're overreacting again
<FromGitter> <Blacksmoke16> these arent modules that are used that often, so doing `Compress::Gzip` once instead of `Gzip` isnt really that much more work
_ht has quit [Remote host closed the connection]
<FromGitter> <ImAHopelessDev_gitlab> it's not, but the principal is what i'm worried about
<FromGitter> <ImAHopelessDev_gitlab> these are core values that make the language a joy to use, the minimalistic design and slick syntax. the last thing i want is for the language to be littered with colons and added developer stress to write more text, just to access modules
zorp has quit [Ping timeout: 260 seconds]
<FromGitter> <ImAHopelessDev_gitlab> it doesn't seem like a big of an issue because the crystal developer who has used the language for quite some time is so comfortable/used to it. ⏎ however, i put myself into the state of mind of when i first found out about crystal, that's very important. when i first started to learn, i'd be turned off heavily by colons and excessive namespace usage, i don't want that to happen
<FromGitter> <Blacksmoke16> its a balance, not everything in the stdlib should be namespaced, i.e. i doubt you would ever have to do like `Collection::Array(Int32)` or something, but namespacing is generally a good idea. Especially when writing shards
<FromGitter> <ImAHopelessDev_gitlab> i really hope not, but do you at least understand where i am coming from?
<FromGitter> <Blacksmoke16> yes, and unfortunately there arent too many options to avoid long names
<FromGitter> <Blacksmoke16> other than aliases, or including that type into another
<FromGitter> <Blacksmoke16> ES6 import system would be 💯
<FromGitter> <ImAHopelessDev_gitlab> never experienced that import system, but thanks for listening. and at least you know where my position is on this matter
<hightower2> Why not G = Compress::Gzip as the first line in your code, and then do as you please with "G"
<FromGitter> <tenebrousedge> Ruby uses colons and namespaces in the same way...
<FromGitter> <Blacksmoke16> For reference
<FromGitter> <Blacksmoke16> Yes, that would be an alias
<FromGitter> <Blacksmoke16> Private aliases could work, especially private ones
<FromGitter> <Blacksmoke16> Oops
<FromGitter> <Blacksmoke16> A large majority of languages use namespacing, most just have some built in way to make it so you don't need to use the fqn all the time in a given file
<FromGitter> <Blacksmoke16> Ruby, and by extension don't
<FromGitter> <Blacksmoke16> Crystal*
DTZUZU has quit [Ping timeout: 240 seconds]
<FromGitter> <ImAHopelessDev_gitlab> i'll send an email/message to brian and ask him to add a namespacing example on the front page
<FromGitter> <Blacksmoke16> Probably not really needed but okay
<FromGitter> <Blacksmoke16> It would essentially just be an example of modules
<FromGitter> <ImAHopelessDev_gitlab> my point is: it's un-crystal like
<FromGitter> <ImAHopelessDev_gitlab> i was being sarcastic
<FromGitter> <Blacksmoke16> its not un-crystal like tho
<FromGitter> <ImAHopelessDev_gitlab> i doubt they'd want an example on the front page of example code littered with colons and namespaces.
<FromGitter> <Blacksmoke16> its a core part of crystal if anything
<FromGitter> <Blacksmoke16> lol k
<FromGitter> <Blacksmoke16> heres a question for you then
<FromGitter> <Blacksmoke16> say you make a shard called `MyShard`
<FromGitter> <Blacksmoke16> and i make a shard called `MyShard`
<FromGitter> <Blacksmoke16> and within these shards we define a `Client` class
<FromGitter> <Blacksmoke16> w/o using namespaces
<FromGitter> <Blacksmoke16> and someone installs both of our shards as they provide different functionality
<FromGitter> <tenebrousedge> the work required to implement `import Foo as F` seems way out of proportion with the benefits. Assuming that's the preferred idea
<FromGitter> <ImAHopelessDev_gitlab> we'll, i'd use different names for my shards. kinda like methods should all be uniquely named (method overloading is confusing and a ambiguous nightmare)
<FromGitter> <Blacksmoke16> how would you use the `Client` class from my shard versus the one from your shards?
<FromGitter> <tenebrousedge> method overloading is also a core part of Crystal
<FromGitter> <Blacksmoke16> So you would name your client class as `SomeUniqueNameClient`
<FromGitter> <ImAHopelessDev_gitlab> i'd just name it differently
<FromGitter> <Blacksmoke16> the name of the shard in the case isnt really the point, the point is two `Client` classes that do different things defined on the top level namespace would conflict
<FromGitter> <Blacksmoke16> but you wouldnt know about my shard
<FromGitter> <Blacksmoke16> so how would you make sure you name is differently then every other shard out there that may be defining stuff on the top level?
<FromGitter> <tenebrousedge> and as the third-person developer what is your solution? just don't use one or the other library?
<FromGitter> <ImAHopelessDev_gitlab> by not installing those shards that have that name lol
<FromGitter> <Blacksmoke16> great solution
<FromGitter> <tenebrousedge> do you check every class that every shard you use to make sure they don't conflict?
<FromGitter> <Blacksmoke16> i meant to be fair he's right, but ofc its not an actual solution if you need/want to use two shards that have a conflict in a type name
<FromGitter> <Blacksmoke16> hence namespacing
<FromGitter> <Blacksmoke16> and why its useful
<FromGitter> <Blacksmoke16> `SomeShard::Client` versus `OtherShard::Client`
<FromGitter> <Blacksmoke16> two unique types, no longer conflicting
<FromGitter> <tenebrousedge> other languages learned this, to their cost. PHP didn't have namespacing for a long time. It was ugly
<FromGitter> <ImAHopelessDev_gitlab> i agree it can be useful, but just don't think the language should have PRs merged that increase the chances of the average crystal developer to have to use them..
<FromGitter> <Blacksmoke16> have you actually ever used any type that those PRs affected?
<FromGitter> <Blacksmoke16> e.x. anything in https://crystal-lang.org/api/master/Compress.html or `DWARF, Elf and MachO`
<FromGitter> <Blacksmoke16> chances are no. I used `Gzip` once, so chances are the avg dev wont need them, so all they are doing is polluting the top level namespace
<FromGitter> <Blacksmoke16> so needing to do `Compress::Gzip` that one time is not a big deal for how often these things are used
<FromGitter> <Blacksmoke16> one thing that will be nice is namespacing things within docs but not actually changing the types
<FromGitter> <ImAHopelessDev_gitlab> not yet, but scared it might set a precedent and foundation of it happening to other classes. then the new crystal dev in 3-5 years has to deal with them (which most likely might be a turn off). "oh wow, this syntax is so slick!", 5 minutes later, `require "SocketFactory/socket"`...
<FromGitter> <Blacksmoke16> i doubt people choose not to use a language because that have to type some `::` a few times
<FromGitter> <Blacksmoke16> in other languages having that style of require/imports prevents you from including code that you're not using
<FromGitter> <ImAHopelessDev_gitlab> true, but i believe it diminishes the beautiful syntax we already have
<FromGitter> <ImAHopelessDev_gitlab> it's like a diamond, why rough it up
<FromGitter> <Blacksmoke16> crystal doesnt need that as unused stuff is just not included in the binary
<FromGitter> <Blacksmoke16> yes, which is why you dont namespace everything
<FromGitter> <Blacksmoke16> `Crystal::Int32` is overkill
<FromGitter> <Blacksmoke16> or `Crystal::Collection::Array`
<FromGitter> <ImAHopelessDev_gitlab> only time a diamond needs to be cleaned, is if it's dirty. doing `require "socket"` is the *total opposite* of being dirty
<FromGitter> <Blacksmoke16> because needing to add a `/tcp` to that would totally be game over
<FromGitter> <ImAHopelessDev_gitlab> core values and principles!
<FromGitter> <Blacksmoke16> i do that with `HTTP` stuff, `require "http/client"` if i only want to use the client
<FromGitter> <Blacksmoke16> makes intent more clear
<FromGitter> <Blacksmoke16> and i like to think it makes a small diff in compile time as im not requiring stuff i dont need
<FromGitter> <ImAHopelessDev_gitlab> i don't mind something like that, i mean require "SocketFactory/socket" or SocketFactory::TCPServer.new
<FromGitter> <ImAHopelessDev_gitlab> stuff like that
<FromGitter> <ImAHopelessDev_gitlab> in fact, i agree with you there. http/client is more clear
<FromGitter> <Blacksmoke16> well at that point its not a factory :P if anything i could see `Socket::TCP.new`
<FromGitter> <Blacksmoke16> `require "socket/tcp"`
<FromGitter> <ImAHopelessDev_gitlab> don't mind that
<FromGitter> <Blacksmoke16> mhm
<FromGitter> <ImAHopelessDev_gitlab> if dev can do TCPServer.new
<FromGitter> <Blacksmoke16> id be in favor of moving this stuff to some common thing, i dont think they're used often enough to warrent having like tcp server/socket, udp socket, unix server/sock on the top level
<raz> law #4 of the internet
<raz> the tiniest things get the biggest debates
<raz> :p
<FromGitter> <jwaldrip> Does anyone have experience with clear?
<FromGitter> <Blacksmoke16> I used it a while ago, why?
FromGitter has quit [Remote host closed the connection]
oprypin has quit [Quit: Bye]
oprypin has joined #crystal-lang
FromGitter has joined #crystal-lang
<FromGitter> <user45789> clear linux ?
<raz> clear ORM probably
<FromGitter> <jwaldrip> Clear ORM
<FromGitter> <jwaldrip> Having an issue with CTEs.
<FromGitter> <jwaldrip> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5ea4c544568e5258e484a4cd]
<FromGitter> <Blacksmoke16> Cte? Sounds like something new
<FromGitter> <jwaldrip> Common Table Expression
<FromGitter> <jwaldrip> as in a SQL CTE
<FromGitter> <Blacksmoke16> TIL
<FromGitter> <j8r> logically, it would be `require "compress/gzip"`