ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
void09 has left #crystal-lang [#crystal-lang]
<FromGitter> <abduct> weird. im just basing this off my calculator
<FromGitter> <abduct> i guess ill just abs the parameters to work around it
<FromGitter> <Blacksmoke16> paran and stuff all in right spots?
<FromGitter> <abduct> https://carc.in/#/r/edwg
<FromGitter> <abduct> using division in atan() gives me 0 lol
<FromGitter> <abduct> whats the difference between atan and atan2?
<FromGitter> <Blacksmoke16> `atan2` Calculates the two-argument arc tangent of the ray from (0, 0) to (x, y). ⏎ `atan` Calculates the arc tangent of value.
<FromGitter> <abduct> that actually explains alot.... no wonder i was having difficulties in other areas >.>
<FromGitter> <abduct> many thanks for the help
<FromGitter> <Blacksmoke16> np
<FromGitter> <Blacksmoke16> ref: https://crystal-lang.org/api/Math.html#atan2%28y%3AFloat32%2Cx%3AFloat32%29%3AFloat32-instance-method
<quazimodo> it seems like the crystal spec suite doesn't have the equivalent of rspec's 'let' does it
<quazimodo> ah and it also pollutes things with '.should' instead of having expectation wrappers
<quazimodo> i've started to play with crystal a bit, it seems like it actually tries to keep types as open as possible & rely on duck typing as much as possible, rather than the super restrictive type approach that you find in things like typescript
<quazimodo> is that ~ resonably correct?
<FromGitter> <naqvis> that's not true. `duck typing` is achieved when you don't restrict params with types. But when you annotate parms with types, then they are strongly typed. ⏎ ⏎ ``` def foo(arg) ⏎ # ...``` [https://gitter.im/crystal-lang/crystal?at=63c0cb523b37dd2c11787e43]
<quazimodo> hrm
<quazimodo> the type system in crystal still confuses me, then
<quazimodo> perhaps my own education on type systems is insufficient
<quazimodo> basically it confuses me that we have a structural type system, but can't say def do_something(client : <anything has #post(path : String, data : String) : Boolean>)
<quazimodo> though if we implement def do_something(client) and thn try to do client.post("foo", "bar") then it'll statically analyze & fail if a passed client doesn't have that methdo
<quazimodo> the naming matters
<quazimodo> so i'm not sure, is it a nominal & a structural type system?
<FromGitter> <naqvis> for sure its not structural type system (like Golang)
<FromGitter> <naqvis> i would suggest you better stick to `static typing`
<FromGitter> <naqvis> and when you are comfortable, you can use its features like `duck typing`, `unions` etc
<quazimodo> i saw somewhere saying that it's a structural type system
<FromGitter> <naqvis> not sure if we are talking about same thing
straight-shoota has quit [Ping timeout: 260 seconds]
jhass has quit [Ping timeout: 260 seconds]
straight-shoota has joined #crystal-lang
jhass has joined #crystal-lang
ur5us has quit [Ping timeout: 246 seconds]
<FromGitter> <z:uxn.one> Hello, I'm equally new to crystal and Rust. ⏎ I'm wondering, what benefits does Crystal provide that are lacking in Rust, and what things does Crystal lack that might be dealbreakers?
<FromGitter> <Blacksmoke16> prettier syntax for one
walez has joined #crystal-lang
<FromGitter> <Blacksmoke16> im not very familiar with rust, but from what i hear it's mainly focused at systems programming while Crystal is more general purpose?
<FromGitter> <Blacksmoke16> main con of Crystal id say would be its smaller ecosystem and longer compile times, but overall is quite joy to work with
walez has quit [Client Quit]
<FromGitter> <z:uxn.one> What's the compile time like? is it 5 mins for an HTTP server or something/ haha
<FromGitter> <Blacksmoke16> depends on the size of the application and if you're in release mode or not
<FromGitter> <Blacksmoke16> debug build for me on a simple webapp with 2 endpoints using a framework is 3s while a release build is 32s
<FromGitter> <Blacksmoke16> know some people their release builds can be 10s of minutes
<FromGitter> <Blacksmoke16> for quite large application
<Elouin> The top pros for me compared to rust: prettier syntax, uses vcs instead of yet another package manager for dependency management, high level like OOP.
<FromGitter> <z:uxn.one> https://github.com/du64/scripts
<Elouin> The main con compared to rust: The lack of a proper tree sitter implementation and thus no helix support (yet).
<FromGitter> <z:uxn.one> here's the extent of my Rust knowledge, my crystal knowledge is comparable although less because of not as much community interest
<Elouin> but thats just my personal ones.
<FromGitter> <Blacksmoke16> for scripts like this could prob just use an interpreted lang like Ruby
<FromGitter> <Blacksmoke16> crystal would most likely be more performant once you compile and have your release binary tho, but also perf is unlikely to really matter. Crystal syntax would be the biggest win imo tho
<FromGitter> <z:uxn.one> syntax is what I'm mostly after
<FromGitter> <Blacksmoke16> crystal also has an experimental interpreter, so some progress is being made in that DX regard as well
<FromGitter> <z:uxn.one> I jumped on the Rust hype train juat like thousands of others when we heard about its inclusion in Linux
<FromGitter> <Blacksmoke16> ```code paste, see link``` ⏎ ⏎ would be your download script in Crystal [https://gitter.im/crystal-lang/crystal?at=63c0ed007de82d261627a7a4]
<FromGitter> <z:uxn.one> I actually dont remember coming across Crystal, often times I use technology in a half awake state, where my brain is fully functional, but I remember nothing when I fully wake up lol
<FromGitter> <z:uxn.one> oh neat! thanks for writing it, that was my next plan is to rewrite my stuff in Crystal
<FromGitter> <Blacksmoke16> other one will be a bit more involved, but prob can get by via the stdlib
<FromGitter> <z:uxn.one> You dont have to write them all, you didn't even have to write that one, but I appreciate it
<FromGitter> <Blacksmoke16> er i dont really know what its doing, but maybe :P
<FromGitter> <z:uxn.one> the Matrix ones?
<FromGitter> <Blacksmoke16> first one was easy so only took a min
<FromGitter> <Blacksmoke16> yea, seems to be relying on some external libs? not sure those would exist in crystal atm
<FromGitter> <Blacksmoke16> so if its just an http API would have to manually use `HTTP::Client` or implement the wrapper client yourself
<FromGitter> <z:uxn.one> They rely on the `matrix-sdk` rust lib
<FromGitter> <z:uxn.one> the `matrix-addons-payout-calculator` is a Matrix.org bot that does the same thing as the one you translated, but in a chat like this
<FromGitter> <Blacksmoke16> https://shards.info/search?query=matrix found a few shards that may work :shrug:
<FromGitter> <Blacksmoke16> id suggest starting with https://crystal-lang.org/reference/1.7/getting_started/index.html
<FromGitter> <z:uxn.one> Rust has so much more community behind it, but you can't build community if you go with the already large langs, so I'm hopeful that I'll enjoy Crystal
<FromGitter> <Blacksmoke16> i think you will :)
<FromGitter> <z:uxn.one> I've learned that first impressions are vital to the success of a lang, and so far Crystal (despite being young and small) has been a very welcoming place
<FromGitter> <Blacksmoke16> glad to hear!
<FromGitter> <Blacksmoke16> hope things go well, but for now im off to bed o/
<FromGitter> <z:uxn.one> I'm also glad that the Crystal team picked Matrix instead of Discord, Slack, or other proprietary communication apps with communist ties (seriously!)
<FromGitter> <Blacksmoke16> there's also a unofficial discord thats prob more active than gitter, but yes options are good i suppose
<FromGitter> <Blacksmoke16> granted Crystal went with Gitter which i think has since been bought by matrix or something, hence the better integration?
<FromGitter> <z:uxn.one> Matrix started Element, who bought Gitter, then made it independent but related to Matrix
<FromGitter> <z:uxn.one> nvm Element still owns Gitter
<FromGitter> <z:uxn.one> well I seriously appreciate your willingness to help newcomers and your enthusiasm for the lang <3
<quazimodo> Elouin: what's helix?
Sankalp has quit [Ping timeout: 272 seconds]
<Elouin> The editor I use.
Sankalp has joined #crystal-lang
_ht has joined #crystal-lang
<quazimodo> what's a tree sitter
<quazimodo> something to do with LSP?
<quazimodo> oh i see, different
<quazimodo> seems quite interesting
<quazimodo> the guy who wrote one of the very popular OG autocomplete libs in emacs made the case that _emacs_ should not implement autocomplete, but that it should be a separate process/program that does it in order to maximise compatibility
<quazimodo> i was a new little tech skiddie so i had no idea what to think really but i'm liking how LSP, DAP & things like tree sitter are evolving
walez has joined #crystal-lang
quazimodo has quit [Read error: Connection reset by peer]
quazimodo has joined #crystal-lang
alexherbo2 has joined #crystal-lang
quazimodo has quit [Ping timeout: 255 seconds]
<FromGitter> <f1reflyylmao:matrix.org> Is there a way to peek into channels?
Sankalp has quit [Ping timeout: 252 seconds]
Sankalp has joined #crystal-lang
Sankalp has quit [Ping timeout: 265 seconds]
Sankalp- has joined #crystal-lang
Sankalp- is now known as Sankalp
Sankalp has quit [Ping timeout: 252 seconds]
Sankalp has joined #crystal-lang
walez has quit [Quit: Leaving]
Sankalp has quit [Ping timeout: 260 seconds]
Sankalp has joined #crystal-lang
Sankalp- has joined #crystal-lang
Sankalp has quit [Ping timeout: 260 seconds]
Sankalp- is now known as Sankalp
hightower2 has quit [Ping timeout: 260 seconds]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #crystal-lang
<FromGitter> <Blacksmoke16> to check if there is something to recieve?
hightower2 has joined #crystal-lang
Vexatos_ has quit [Quit: Client Quit]
Stephie- has quit [Quit: Fuck this shit, I'm out!]
alexherbo2 has quit [Remote host closed the connection]
Stephie has joined #crystal-lang
alexherbo2 has joined #crystal-lang
Vexatos has joined #crystal-lang
hightower2 has quit [Quit: Leaving]
jmdaemon has joined #crystal-lang
<FromGitter> <z:uxn.one> does Crystal have guaranteed memory safety like Rust,
jmdaemon has quit [Ping timeout: 272 seconds]
<FromGitter> <Blacksmoke16> if you're not using any unsafe code you should be fine, but its still possible to go low level with pointers and such and break stuff
jmdaemon has joined #crystal-lang
jmdaemon has quit [Ping timeout: 246 seconds]
jmdaemon has joined #crystal-lang
jmdaemon has quit [Ping timeout: 272 seconds]
<FromGitter> <z:uxn.one> Screenshot from 2023-01-13 14-42-28.png (https://gitter.ems.host/_matrix/media/v1/download/uxn.one/GseURePVQGyShcMKgxjzkanU)
<FromGitter> <z:uxn.one> Why when I try to install Crystal on Debian does it instead try to install rustdesk?
renich has joined #crystal-lang
<FromGitter> <jrei:matrix.org> Upgrade perhaps
_ht has quit [Quit: _ht]
ur5us has joined #crystal-lang
ur5us has quit [Quit: Leaving]
Sankalp has quit [Ping timeout: 260 seconds]
Sankalp has joined #crystal-lang
Sankalp has quit [Ping timeout: 260 seconds]
Sankalp has joined #crystal-lang
Sankalp- has joined #crystal-lang
Sankalp has quit [Ping timeout: 268 seconds]
Sankalp- is now known as Sankalp
Sankalp has quit [Ping timeout: 272 seconds]
Sankalp has joined #crystal-lang
FromGitter has quit [Remote host closed the connection]
oprypin has quit [Quit: Bye]