ChanServ changed the topic of #crystal-lang to: The Crystal programming language | | Crystal 0.23.1 | Fund Crystal's development: | GH: | Docs: | API: | Gitter:
<FromGitter> <asterite> Interfaces to the rescue? :)
<oprypin> what interfaces
<oprypin> there's no interface for []= in stdlib
<oprypin> might as well hardcode the union then
hightower4 has joined #crystal-lang
hightower3 has quit [Ping timeout: 255 seconds]
wontruef_ has quit [Quit: The Internet needs a break and I need a cookie]
<FromGitter> <faustinoaq> > I'd love to see Crystal continue moving forward, but sometimes you need a break. @asterite you've done a ton of work, and I love the Crystal language. So thank you for all you've done! ⏎ ⏎ Yes, @asterite Thanks you! I learnt a lot using Crystal, All work done in Crystal is a great effort, I think Manas and this community will make Crystal production ready, we know the limitations but our strengths are
<FromGitter> ... our hope 💪
Creatornator has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
_whitelogger has joined #crystal-lang
snsei has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
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]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
Creatornator has joined #crystal-lang
lacour has quit [Quit: Leaving]
tyler569 has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tyler569 has quit [Quit: WeeChat 1.9.1]
RickHull has joined #crystal-lang
gcds has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] ysbaddaden closed pull request #5100: Complex.hash(hasher). (master...complex.hash)
<crystal-gh> [crystal] ysbaddaden closed pull request #5085: Short circuit Hash#find_entry for empty Hashes (master...faster_empty_hash_lookup)
rohitpaulk has joined #crystal-lang
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<travis-ci> crystal-lang/crystal#53b208c (master - Short circuit Hash#find_entry for empty Hashes): The build passed.
<travis-ci> crystal-lang/crystal#0370db1 (master - Complex.hash(hasher).): The build passed.
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #crystal-lang
baweaver is now known as baweaver_away
RickHull has quit [Quit: Page closed]
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
A124 has quit [Read error: Connection reset by peer]
A124 has joined #crystal-lang
DTZUZO has quit [Ping timeout: 248 seconds]
alex`` has quit [Quit: WeeChat 1.9.1]
alex`` has joined #crystal-lang
alex`` has quit [Client Quit]
alex`` has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
alex`` has quit [Quit: WeeChat 1.9.1]
alex`` has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<Papierkorb> Huh, `Dir["/home/.."]` returns empty array, but `Dir["/home"]` returns `["/home"]` as expected
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter> <bew> `Dir["/home/../*"]` works though
<Papierkorb> . and .. are fine anywhere except as last element
<Groogy> huh that has to be a bug
<Papierkorb> So, my specs are now finding stdlib bugs. nice.
rohitpaulk has joined #crystal-lang
adam12 has left #crystal-lang ["Leaving..."]
<Papierkorb> And `Dir["/"]` raises
<FromGitter> <bew> well `Dir[]` is a shortcut for `Dir.glob`, and what is a glob without stars `*` ? what's the point ? (though I agree, it shouldn't do weird things)
<Papierkorb> bew, to allow the user to give me paths using globs. If the user decides to not use globbing, that's their business.
<FromGitter> <bew> hmm maybe detect if it's a glob pattern, and if it's not, don't try to use glob?
<Papierkorb> That doesn't solve anything.
<Papierkorb> I'm not eager to trash my code to work around an issue everyone has
<Papierkorb> not to mention that `*/..` is still broken
<FromGitter> <bew> yeah true
ShalokShalom_ has joined #crystal-lang
gcds has joined #crystal-lang
ShalokShalom has quit [Ping timeout: 240 seconds]
andrey_vasilyev has joined #crystal-lang
andrey_vasilyev has quit [Quit: Leaving]
rohitpaulk has quit [Ping timeout: 248 seconds]
gcds has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has joined #crystal-lang
gcds has joined #crystal-lang
ShalokShalom_ is now known as ShalokShalom
<crystal-gh> [crystal] asterite closed pull request #5113: Add Math sqrt overloads for Bigs (master...master)
<FromGitter> <asterite> Someone should rewrite Dir.glob from scratch and without regex, but it's a huge task
<FromGitter> <taylorfinnell> Would a seek method make sense in IO::Sized?
<jhass> sue why not
<jhass> *sure
<FromGitter> <taylorfinnell> Also, in `File`, some how `#read_at` is being called and I'm ending up with a `File::PReader` which does not `#seek` but I can't figure out how I am ending up with the `File::PReader` object
<FromGitter> <bew> > some how #read_at is being called ⏎ When doing what?
<travis-ci> crystal-lang/crystal#bdf35a8 (master - Add Math sqrt overloads for Bigs (#5113)): The build passed.
<DeBot_> (Add Math sqrt overloads for Bigs)
<FromGitter> <taylorfinnell> Trying to get a smaller example, let me see if I can
<FromGitter> <taylorfinnell> i think it's because I use `IO` as the type but give it a `File`
<FromGitter> <taylorfinnell> Which I guess makes sense since `IO` doesn't have #seek
<FromGitter> <taylorfinnell> yea that's why
<FromGitter> <bew> what do you mean?
<FromGitter> <taylorfinnell> I thought IO interface had a seek method, but I was wrong, so this does not work
<FromGitter> <taylorfinnell> ```code paste, see link``` []
<FromGitter> <taylorfinnell> undefined method seek on File::PReader
<FromGitter> <asterite> It will have one once this PR is merged:
<FromGitter> <asterite> (by default raising)
<FromGitter> <taylorfinnell> awesome! I did not notice this PR, thank you :)
<FromGitter> <asterite> What are you trying to do?
<FromGitter> <taylorfinnell> parse a file format where I need to seek around the file to certain chunks
<FromGitter> <asterite> File has seek
<FromGitter> <asterite> and if the big is not too big you can read it to memory, it'll be faster
<FromGitter> <taylorfinnell> Yea, I will not allow any IO and just allow File. I want to support parsing file from http stream so I think I will need to add seek to IO::Sized
<FromGitter> <asterite> You can't seek an http stream
<FromGitter> <asterite> not because of a missing method, it's plain impossible
<FromGitter> <asterite> it's a read only stream
<jhass> do you truly need to seek btw? Many formats are designed in a way that skipping is enough
<FromGitter> <taylorfinnell> Hmm I will check, maybe I don't and can just use skip. Thanks everyone
<FromGitter> <asterite> It's always better if you ask help for "I want to parse file format X" rather than "why IO::Size doesn't have #seek"
<jhass> got me thinking, wouldn't it be nice to have optionally implementable methods and a way to check for them? Then IO#skip could be implemented in terms of #seek if available and just #read if not
<Papierkorb> We have optionally implementable methods.
<Papierkorb> It's called "overriding"
<jhass> but how do you check at compile time whether it's implemented?
<Papierkorb> You don't. You provide an implementation, and if a sub-class wants to provide a better one, it simply overrides the previous method
<jhass> so if there's an optimized implementation that's common to all subclasses that implement it, you have to repeat it in each
<FromGitter> <taylorfinnell> Trying to parse TIFF images, and from what I understand the IFD chunks may not be ordered.Trying to confirm that though
<Papierkorb> jhass: No, it just means the inheritance architecture is faulty. If it's not possible through plain-old inheritance, simply move the better implementation into some module, and include that module if you want it
<jhass> that's still something you can forget to do though
<Papierkorb> jhass: "is_a?" or "responds_to" style programming should be avoided if possible. It's not clean and can lead to non-obvious behaviour. A parent class suddenly changing its behaviour if a sub-class does something, that's the definition of unexpected behaviour
<Papierkorb> Then you forgot it.
<Papierkorb> Then you add it.
<Papierkorb> Don't try to fix developer laziness through magic
<jhass> now you can argue if it it's a true behavior change or just an optimization though, in my example anyway
<Papierkorb> An "optimization" is a huge change and can easily break stuff
<FromGitter> <asterite> There's TypeNode.overrides? in macros which I added at one point because I needed this, but it's probably not well thought
<Papierkorb> asterite, I think it's perfectly fine for the macro system to have this feature. There are use-cases for it.
<Papierkorb> But this one is not one of those
<FromGitter> <bew> 👍
<FromGitter> <asterite> Papierkorb: why? You can do `{{ if @type.overrides?(IO, "seek") }}`
<Papierkorb> You can do it. I'm arguing if that's a good idea in all cases.
<FromGitter> <asterite> It's probably not. It's a hack I added at one point and I'm not convinced at all about it
<Papierkorb> That #overrides? function you mean? It's an important feature for certain use-cases (binding generation, RPC)
<Papierkorb> The macro system is there to solve not-every-day use-cases. I think it's perfectly fine to expose much functionality in there.
<Papierkorb> I just checked, I haven't used #overrides? yet. Though I could've in bindgen.
<crystal-gh> [crystal] RX14 pushed 1 new commit to master:
<crystal-gh> crystal/master 1d401e4 Akzhan Abdulin: Optimized BitArray.hash(hasher) (#5101)...
alex`` has quit [Quit: WeeChat 1.9.1]
alex`` has joined #crystal-lang
<travis-ci> crystal-lang/crystal#1d401e4 (master - Optimized BitArray.hash(hasher) (#5101)): The build passed.
<DeBot_> (Optimized BitArray.hash(hasher))
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
Creatornator has joined #crystal-lang
<crystal-gh> [crystal] RX14 closed pull request #5093: Add documentation and type annotations for Time (master...time-doc)
rohitpaulk has quit [Ping timeout: 260 seconds]
<Groogy> hmm I am constantly second guessing me if I should go for tiles or if I should have a height map
<Groogy> heightmap would be more fine grained but with tile map would be easier to achieve the style I will probably go for
<Papierkorb> What's the right way to do it?
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Groogy> meh just depends on what you want
<Groogy> heightmap would make it look like this
<Groogy> while tilemap will make it look more like how I showed before
<Groogy> heightmap might be harder though to actually place things "nicely" on it
rohitpaulk has joined #crystal-lang
<Groogy> working on the ramps now ^^
rohitpaulk has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] RX14 opened pull request #5119: Add remove_empty option to many String#split overloads (master...feature/split-remove-empty-strings)
alex`` has quit [Ping timeout: 255 seconds]
alex`` has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter> <bararchy> Groogy, this is really cool :)
DissonantGuile has joined #crystal-lang
<FromGitter> <drujensen> wow. awesome!
<DissonantGuile> Anyone know of a libusb binding? I feel like I might be wasting my time making my own but I dont see one anywhere
<oprypin> DissonantGuile, no, never heard of libusb.
<DissonantGuile> Ah cool, didn't even know about that site heh
rohitpaulk has quit [Quit: Ping timeout (120 seconds)]
gcds has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] MakeNowJust opened pull request #5120: Prevent to type ivar having initializer as nilable on assignment (master...fix/crystal/5112-not-type-ivar-having-initializer-as-nilable)
gcds has joined #crystal-lang
gcds has quit [Client Quit]
_whitelogger has joined #crystal-lang
<FromGitter> <asterite> Groogy: Cool! I actually have your program running on my machine (Mac OSX). I had to change the config to use an older version of OpenGL (Mac comes with 4.1). Maybe the version can be detected somehow?
<Groogy> yeah it can
<Groogy> it is also why I have the config file ^^ it's quite flexible
<FromGitter> <asterite> Another problem is that when I do `shards build` and then `./dist/main`I get `Error opening file 'test.shader'`. I have to move some files around to get that working
<Groogy> yeah I have a build script in vscode right now
<Groogy> will add a proper makefile later
<Groogy> will shards build invoke a make file if it is inthere?
<FromGitter> <asterite> Just minor things, really. But I'm really amazed how Crystal can show that on the screen :-) (I know most of that is C bindings, but still...)
<Groogy> actually not a lot of it is C bindings
<FromGitter> <asterite> I think not, there's a way to let shard execute something when you install it, but nothing for the build command
<Groogy> yeah I'll just do that the make script will make sure it install the shards
<Groogy> gonna push my changes, do some dishes then I'll get on making a makescript
<Groogy> problem I had before was I didn't have a good way to set the work directory after I had built and wanted to run something
<crystal-gh> [crystal] RX14 pushed 3 new commits to master:
<crystal-gh> crystal/master 24791fd RX14: Improve String#split documentation
<crystal-gh> crystal/master 7bdd444 RX14: Clean up String#split specs
<crystal-gh> crystal/master 1d02669 RX14: Add remove_empty option to many String#split overloads
wontruefree has joined #crystal-lang
snsei has joined #crystal-lang
<crystal-gh> [crystal] RX14 pushed 1 new commit to master:
<crystal-gh> crystal/master e8d9019 Brandon McGinty-Carroll: ensure propper handling of multiple Content-Length headers (#4705)...
xiljin has quit [Quit: ...]
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
<Groogy> the framerate
<Groogy> (ლ╹◡╹)ლ
<Papierkorb> dat emoji
<FromGitter> <bew> wow nice
<Groogy> weechat -> emoji plugin :P
<RX14> Groogy, is that raw gl?
<Papierkorb> Groogy: Do linux systems store the GL bindings in the same place? Or is it hit and miss?
<RX14> also is that GLXOSD?
<RX14> because rip
<Groogy> yeah it is, should just implement my own frame counter
<Groogy> and yeah it is raw gl if you mean just calling the functions
wontruefree has joined #crystal-lang
<RX14> i meant kinda no game engine frameworky stuff (that you didnt write)
<Groogy> ah no
<Groogy> everything written by me
<RX14> makes sense why it runs so fast then haha
<FromGitter> <imonmyown> @oprypin, do you think crsfml installation can be automated to be done via shards alone?
<RX14> i should do a game one day
<RX14> i dont know much about graphics programming
<RX14> just enough to know that I dont know much
<Groogy> well if you just do 2D you don't need to know much
<Groogy> hmm where do truetype fonts usually end up on archlinux...
<RX14> yeah well
<RX14> i meant 3d
<Groogy> oh yeah that requires a bit more knowledge, like linear algebra & so on
<RX14> eww maths
wontruefree has quit [Client Quit]
* RX14 is currently doing an electrical engineering degree
<FromGitter> <imonmyown> @Groogy what's the basic approach to creating text-shadow using OpenGL?
<Groogy> eh depends, are you doing bitmap fonts or something more like truetype fonts?
<FromGitter> <imonmyown> TTFs in 2D
wontruefree has joined #crystal-lang
<Groogy> hmm you mean you have a mesh that are a letter and you want it to cast a shadow?
<Groogy> or do you mean a small outline on the text to make it more readable?
<FromGitter> <imonmyown> I don't know much about OpenGL
<FromGitter> <imonmyown> No, I want a proper shadow
<Groogy> well for one, opengl doesn't understand what text is :P it only understands vertices and textures
snsei has quit [Remote host closed the connection]
<FromGitter> <asterite> Anyone knows what "SSL_connect: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version (OpenSSL::SSL::Error)" means?
<oprypin> imonmyown, no
<Groogy> either way if you are doing shadow buffer maps then essentially you do that, you translate the text to 3D space and render on that buffer
<oprypin> if it was, i'd do it
<FromGitter> <imonmyown> @oprypin sucks
<RX14> @asterite try `openssl errstr`
<FromGitter> <imonmyown> @Groogy guess I'll have to start with the basics either way
Creatornator has joined #crystal-lang
<oprypin> imonmyown, seems like you're too disappointed about installation of crsfml. why so?
<Groogy> hehe yeah
<Groogy> oh whoops I accidentally rendered the text a little bit wrong xD
<FromGitter> <imonmyown> @oprypin, no I'm personally fine with it, just wanted it to be more accessible to others
<RX14> oprypin, whats the problem with doing it automatically?
<oprypin> for distributing a game you wouldn't be using shards anyway, btw
<Groogy> blob:
<FromGitter> <imonmyown> @oprypin, I know
<Groogy> was supposed to render the FPS xD
<Groogy> forgot that I was rendering in 3d context
<FromGitter> <asterite> RX14: with `openssl errstr` I get no output
<RX14> @asterite it's almost certainly a protocol version mismatch either way
alex`` has quit [Quit: WeeChat 1.9.1]
<RX14> use `openssl s_client` with different -ssl and -tls versions to debug it
<oprypin> RX14, it barely works manually lol
<RX14> surely theres a root cause oprypin
<oprypin> is a c++ library
alex`` has joined #crystal-lang
<RX14> oprypin, surely you can generate the bindings and compile at shard install time
<oprypin> Papierkorb is rather optimistic about doing the same for Qt but we'll see about that
<RX14> @asterite make sure the linked openssl version is the same as commandline though
<RX14> on OSX it gets funky because osx is funky
<crystal-gh> [crystal] asterite pushed 2 new commits to master:
<crystal-gh> crystal/master 3fc150d Ary Borenszweig: Make IO a class
<crystal-gh> crystal/master bc412dc Ary Borenszweig: Merge pull request #4901 from asterite/feature/io-as-class...
<oprypin> wew
<Papierkorb> oprypin: check this out if you're wary
<Papierkorb> (About to become even more powerful too)
<oprypin> imho if you have /usr/ anywhere you've already failed
<RX14> well how is the include path set up by default?
<RX14> compiled into g++?
<FromGitter> <asterite> I wish we could always link to one (possibly the latest?) version of openssl
<Papierkorb> RX14: most likely
<RX14> @asterite use linux lol
<RX14> Papierkorb, surely you can figure a way to get it out of g++
<Papierkorb> RX14: I already do for clang lul
<travis-ci> crystal-lang/crystal#e8d9019 (master - ensure propper handling of multiple Content-Length headers (#4705)): The build passed.
<DeBot_> ([bugfix] insure proper handling of multiple Content-Length headers in http)
<RX14> Papierkorb, what about `echo | gcc -E -Wp,-v -`
<oprypin> Papierkorb, you generate bindings for one version of qt then rely on system's qt which can be any version. how will that work?
<Groogy> oh wow when doign the FPS counting in the game...
<RX14> and `echo | g++ -xc++ -E -Wp,-v -` for C++
<Groogy> it's a lot faster
<travis-ci> crystal-lang/crystal#1d02669 (master - Add remove_empty option to many String#split overloads): The build passed.
<Groogy> like by ALOT
<Papierkorb> oprypin: As I said numerous times: Platform detection one the one side, and being reasonable about it on the other.
<oprypin> RX14, just think about Windows before you say anything :|
<Papierkorb> I'm only interested in supporting the common case. Not every possible one.
<RX14> please
<RX14> not everything has to work perfectly on windows
<Papierkorb> If someone has a complex fucked up installation, they can generate it themselves. No issue
<RX14> why would you damn all the linux developers to doing it manually just because it doesnt work on widnows?
<oprypin> why would i damn myself to linux-specific hacks?
<FromGitter> <imonmyown> @RX14, that's the point!
<RX14> oprypin, to make it work
<FromGitter> <imonmyown> @oprypin is that the only option?
<RX14> a hack is fine if it's not too brittle
<oprypin> `shards` is completely immature for cross-platform dev and the promise cannot be kept
<RX14> well shards is simple
<RX14> its not a promise oprypin
<RX14> it's a best effort
<RX14> you make the best effort to work it out and fail
<Papierkorb> I'll try my best. If it doesn't work for them, they can contribute. I have *no* interest in maintaining Windows and Mac for e.g.
<Papierkorb> Nor Debian or Ubuntu.
<RX14> you providing a way to install via shards is not a promise that it works
<oprypin> ok so "common case" is Arch Linux
<oprypin> seemsgood
<Papierkorb> If someone cares, they'll care.
<RX14> thats a bit harsh
<RX14> i think it should generally work on all linux
<RX14> and likely osx
<Papierkorb> oprypin: No, this is just being reasonable. If you give a shit about $OS, then there are all facilities to make a few changes and it'll work.
<Papierkorb> I have other things to do than maintain everything for everyone
<Papierkorb> Like, a real job
<RX14> cross-platform development is a pile of hacks
<Papierkorb> Like, life
<RX14> at least they're hacks in shell scripts not your crystal code
<Papierkorb> If that is not good enough for someone, then so be it.
<oprypin> RX14, yes it is, and I don't want to be maintaining the hacks
<RX14> so make it work for you and make it bail with a nice error message
<RX14> and be done with it until you get a PR
<Papierkorb> ^
<FromGitter> <asterite> Yeah... developing a language is nice unless you hit real life with all of the systems and the differences :-P
<FromGitter> <asterite> unless -> until
<FromGitter> <asterite> Like, now I have this openssl error and it's because in mac it comes with 0.9.8. I have one from homebrew but pkgcfg still gives me 0.9.8
<FromGitter> <asterite> I don't care about all of that, I just want things to work... so hard...
<FromGitter> <bew> wow more PR merging, 0.24 is becoming bigger & bigger ^^
<oprypin> asterite, arch linux is where things work
<RX14> 0.24 should be released soon...
<RX14> @asterite the problem with osx is homebrew is a hack
<FromGitter> <imonmyown> @asterite always had problems with OpenSSL in rust on mac. Like every other time
<FromGitter> <bew> RX14, good to know!
<RX14> theres something special about homebrew openssl iirc
<RX14> best bet is jumping on their irc or whatever
<RX14> or googling it idk
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
<FromGitter> <DRVTiny> Hello, dear All! :) ⏎ How to know all public methods implementted by class "X"?
<FromGitter> <bew> @DRVTiny why do you need that?
<FromGitter> <DRVTiny> Because method names and method calls convention in 80% cases give enough info to know what this class can do.
<oprypin> DRVTiny, or, you know, see that list of methods in documentation
<RX14> ^
<RX14> please encourage shard authors to host documentation
<oprypin> if it wasnt so annoying to do
<RX14> for that matter I should make a public shards doc hosting thingy
<FromGitter> <DRVTiny> For example, i want to know, how to get unix timestamp from the class Time and i dont want to search that information in web browser. In Julia, for example, i have methods(Class), in perl i can perldoc Class, but what about Crystal?
<RX14> where its just
<RX14> @DRVTiny well how else are you going to do it without a web browser?
<oprypin> RX14, for all of these nice projects, the problem is always sandboxing arbitrary code execution
<RX14> yes oprypin
<oprypin> for me, anyway. why does it have to be so extremely hard?
<FromGitter> <DRVTiny> "In Julia, for example, i have methods(Class), in perl i can perldoc Class"
<RX14> a commandline thing would be kinda nice
<FromGitter> <asterite> Search "unix"
<oprypin> from what I see just runs docker and then all over the internet you see that docker does not provide sandboxing at all
<RX14> it does oprypin
<FromGitter> <DRVTiny> Information about methods implemented by class is embedded into the class declaration, why i need to search it in the Internet?
gcds has joined #crystal-lang
<FromGitter> <asterite> (by the way, I think we should rename "epoch" to "unix", "epoc" was a bad choice....)
<RX14> its got good sandboxing
<Papierkorb> it does sandboxing. Though I wouldn't rely on it for security sensitive stuff lul.
<RX14> the problem is that it's not defence in depty
<FromGitter> <asterite> DRVTiny because Crystal is not a dynamic language
<Papierkorb> But that's fine, it's not marketed as security tool
<RX14> disregarding kernel bugs docer would be a perfect sandbox
<RX14> but kernel bugs are a thing
<FromGitter> <DRVTiny> Julia is not dynamic language too. And what thee problem? :)
<RX14> with kernel bugs + placing the process into a nobody user you're fairly safe
<FromGitter> <asterite> Julia is dynamic
<FromGitter> <asterite> Can you compile Julia to an executable?
<RX14> then put that whole docker on a VM which only runs other `crystal doc` runs then you're fine
<FromGitter> <DRVTiny> No, its LLVM-compiled language with strong types
<RX14> you just need a bit of defence in depth oprypin
gcds has quit [Client Quit]
<oprypin> RX14, seems like nonsense to me
<RX14> why oprypin
snsei has joined #crystal-lang
<oprypin> running unsandboxed code does not sound like a good idea
wontruefree has joined #crystal-lang
<RX14> note that that article is from 2014 oprypin
<FromGitter> <DRVTiny> Hmm... I dont know, why i cant get class methods from compiled application? This information is totally lost during compilation?
<RX14> also that travis uses docker as their sandbox
<FromGitter> <asterite> Rust, Java, C#, Nim, most compiled languages use online docs. Crystal is the same. We won't add features to the language so you can search for methods. But you can do it with macros, it's just not convenient. Plus with "type.methods" you don't get their docs. We *could* do something like what Elixir does, but that means always keeping doc comments when compiling, which will make things slower and occupy more
<FromGitter> ... memory
<RX14> as long as you can't get root
<RX14> which is exactly what I suggested
<FromGitter> <asterite> DRVTiny: yes, it's lost during compilation
<oprypin> does not use docker apparently. what it uses is some kind of "playpen" which is apparently this and apparently deprecated and i have no idea what it does
<FromGitter> <asterite> there's no runtime reflection in Crystal
<travis-ci> crystal-lang/crystal#bc412dc (master - Merge pull request #4901 from asterite/feature/io-as-class): The build passed.
<RX14> it uses docker @oprypin lol
<RX14> whats the worst that happens if the VM gets compromised oprypin
<Papierkorb> The host gets compromised too
<Papierkorb> Not unheard of
<RX14> not my problem
<RX14> it's amazon's
<RX14> or whoever you use
<FromGitter> <DRVTiny> @asterite You can place library classes in standart locations such as @INC and provide utility written in any appropriate language to parse class definitions (or use crystal parser itself - its reasonable)
<RX14> @DRVTiny is using a web browser really that much harder than using a commandline tool?
<RX14> if you have docs open already you should just be able to type once we implement fuzzy search
<RX14> also why don't we provide a crystal doc --all option which docs your code + shards + stdlib
<crystal-gh> [crystal] asterite pushed 3 new commits to master:
<crystal-gh> crystal/master ddf8a18 Julien Reichardt: Remove the support of the `compile` command
<crystal-gh> crystal/master 0847c7e Julien REICHARDT: Integrate the if conditions in the case expressions
<crystal-gh> crystal/master 3ff8e59 Ary Borenszweig: Merge pull request #5080 from j8r/if-clean...
<RX14> and is essentially a merged doc of all possible code you can require
<oprypin> RX14, or once we merge fuzzy search
<RX14> then add crystal doc --server as well and you just run crystal doc --all --server in your project
<RX14> and you have a fuzzy searchable documentation of everything you have at your fingertips
<FromGitter> <DRVTiny> Now i have to download libraries aka shards to every application with crystal dep - that is not conveniently at all, though this methodology can be used with class-definition-parser's in the same way.
<RX14> am i crazy?
<FromGitter> <bew> RX14 I like it ;)
<RX14> @DRVTiny what?
<FromGitter> <asterite> You can also search for methods inside your project, because `lib` contains that
<RX14> yeah @asterite but it doesn't give really nice output
<RX14> you can search for method definitions but you cant search for methods given a class name easilly
<FromGitter> <asterite> It's true
<RX14> @DRVTiny i assumed since you want to know the methods of a class you have the shard already
<RX14> i don't understand your complaint
<RX14> I really want to remove crystal deps
<FromGitter> <asterite> Also, given that there's no REPL for crystal, it makes no sense to compile a program just to find out the methods of a type
<RX14> ^
<FromGitter> <asterite> Me too!
<FromGitter> <asterite> Let's remove it. `shards` FTW
<RX14> ddeath to aliases
<oprypin> mhm
<RX14> except Int#second...
<FromGitter> <DRVTiny> @FromIRC Yes, using web-browser is much harder than using icr utility and methods(Class) in commandline - for me, anyway.
<FromGitter> <bew> and :p *I'm out*
<RX14> well icr can do what ICR wants
<RX14> if ICR wants to provide some kind of methods dumper it can
<RX14> but ask in the ICR repo
<RX14> i already suggested they can pre-require some helpers to do this
<oprypin> maybe crystal play should have something
<RX14> crystal play could incorporate the doc browser i guess
<FromGitter> <DRVTiny> @asterite There is ICR - it is very useful to learn Crystal
<RX14> but it would be nice to be able to ctrl-hover types
<RX14> and ctrl-click to jump to docs
<RX14> for types and methods
<RX14> so much fluff we could do
<FromGitter> <asterite> ICR is not maintained by Crystal, it's just a separate project. It's not a real REPL
<FromGitter> <asterite> But yes, this is a really good fit for the playground
<RX14> i never use icr
<RX14> i guess im use to just writing code
<RX14> and testing it
<RX14> the traditional way
<oprypin> command line REPLs really suck
<RX14> as debugger's they['re pretty cool
<RX14> in interpreted languages
<RX14> I think an interpreted crystal could work btw
<RX14> but im too lazy to do that
<FromGitter> <DRVTiny> Julia is not interpreted language, and it has amazing REPL
<RX14> it's a JITed language
<FromGitter> <straight-shoota> the json output from `crystal docs` easily allows to use the docs for other use cases besides a html page.
<oprypin> is that already in?
<FromGitter> <straight-shoota> for example a command line docs viewr
<RX14> @DRVTiny the problem with crystal and repls is the type system
<RX14> julia's type system is local not global and so it can do things we can't
<RX14> or something like that
<FromGitter> <straight-shoota> @oprypin no, but its implemented #4746
<FromGitter> <asterite> Julia is kind of interpreted
<FromGitter> <asterite> You get types from a call, instantiate that call and generate code from that, on the fly
<FromGitter> <asterite> so it's closer to a dynamic language
<FromGitter> <asterite> plus it has a built-in REPL. And things are not compiled to an executable. `a = ...` will just store that at runtime, together with its type information. That's not how Crystal works
<crystal-gh> [crystal] RX14 closed pull request #5096: Remove `expect_raises` matcher without type argument (
<RX14> @asterite you can compile julia AOT
<RX14> and its fast
<RX14> aparrently
<FromGitter> <DRVTiny> @asterite Understand... Thank you!
<FromGitter> <asterite> Ah, cool, it seems they finally did it. In any case, the REPL mode was the first thing they did, and how it only worked, so it makes sense to be able to reflect on things at runtime.
<RX14> perhaps a repl is possible in crystal
<RX14> but it's sure to require a lot lot lot of resources
<RX14> and work
<crystal-gh> [crystal] asterite closed pull request #5061: Regex: support duplicated named captures (master...feature/regexp/duplicated-named-capture)
lacour has joined #crystal-lang
<oprypin> this will be one spicy release :)
<RX14> wow @asterite remembered the Next milestone for once lol
<FromGitter> <asterite> :D
<RX14> btw 'asterite we typically use rebase or squash+rebase merge modes, not merge commits
<Groogy> gah need to stop working, should eat
<Groogy> get nourishment
<RX14> it's just a bit cleaner and ensures the commit log is properly ordered
<RX14> if only github showed the dag properly instead of a linear list it'd be much nicer
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
<FromGitter> <asterite> Ah, right, I sometimes forget about that
<RX14> we need to automate it
<oprypin> RX14, ok if docker really is the answer, then why all the complexity?
<RX14> which is kindof my job with CI
<RX14> oprypin, defence in depth
<RX14> just like using a vm requires the hypervisor to not have security bugs, using docker requires the kernel not to have security bugs
<RX14> so layering unix users on top of docker on top of a VM is much better
<RX14> and it removes the downsides of a VM as long as you keep the vm running
<RX14> since starting up docker is much faster than starting up a vm
<RX14> s/docker/a container/
<RX14> and that happers for first-load when we need to build uncached docs
<RX14> s/happers/matters
<RX14> im so bad at typing
<Papierkorb> What's the absolute path to cmd.exe on a common windows installation?
<Papierkorb> C:\WINDOWS\System32\cmd.exe ?
<oprypin> i think that's correct
<oprypin> i mean you can look it up
<RX14> you can probablt use %windor% or some shortcut for system32
<FromGitter> <faustinoaq> @DRVTiny also you can use
<oprypin> %cmd%
<oprypin> Papierkorb, btw i think there's no good reason to need that path
<RX14> %windir%/System32/cmd.exe ?
<oprypin> %cmd%
<RX14> %ComSpec%, no?
<Papierkorb> Yeah I think there's perfect reason to need that path when testing that the path finding works correctly
<travis-ci> crystal-lang/crystal#3ff8e59 (master - Merge pull request #5080 from j8r/if-clean): The build passed.
<DeBot_> (Integrate the "if" conditions into the "case" expressions)
<FromGitter> <faustinoaq> @DRVTiny you can use devdocs via command line too
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RX14> there have been more commits since 0.23.1 than there was between 0.23.1 and 0.21.0
<RX14> actually not more, about the same
<RX14> i think its time for a release
<RX14> especially considering how many of those were breaking
<travis-ci> crystal-lang/crystal#3f99c77 (master - Remove expect_raises without type argument (#5096)): The build passed.
<DeBot_> (Remove `expect_raises` matcher without type argument)
<travis-ci> crystal-lang/crystal#c1e8b70 (master - Merge pull request #5061 from MakeNowJust/feature/regexp/duplicated-named-capture): The build passed.
<DeBot_> (Regex: support duplicated named captures)
<FromGitter> <bew> Yeah with about 180 issues/PRs in Next milestone
wontruefree has joined #crystal-lang
<RX14> i looked at commits
<RX14> its over 250 commits
<FromGitter> <straight-shoota> it's also been three months since last release
<Groogy> ugh I am messing up my drag drop somehow :/
<FromGitter> <OldhamMade> qq, in elixir you can define a function with a keyword list as the last argument, and it's auto expanded. eg: ⏎ ⏎ ```def foo(a, b, opts) do ... end ⏎ foo(1, 2, opt_a: 1, opt_b: 2)``` ⏎ ⏎ Is it possible to do something similar with Crystal? []
<Groogy> hmmm why does it reset to like... start all the time
<Groogy> I can't see why like, the drag/rotation starts over at zero :/
<Groogy> oh wait I am dumb nvm
<Groogy> helps talking out loud xD
<FromGitter> <jasonrobot> @OldhamMade you can use **opts in the parameter list, and then named parameters will be passed in as a named tuple
<Papierkorb> OldhamMade, hard to tell if it's what you're looking for from your description, but sounds like `def foo(**opts)`
<FromGitter> <jasonrobot> not sure if that's quite what you're looking for
<FromGitter> <OldhamMade> @jasonrobot I think that's what I'm looking for, thanks (+@papierkorb)
Creatornator has joined #crystal-lang
<FromGitter> <jasonrobot> I've got a question of my own: How can I call methods defined in a module? The docs make it look possible, but it the compiler says "expecting token 'CONST' not 'foobar'" (where foobar is the method name)
<Papierkorb> jasonrobot, if you'd show the source yielding that error, that'd help.
<FromGitter> <jasonrobot> dunno if it actually needs the include, but same result either way
<Papierkorb> No that include is not only useless, but actually clutters the global scope (Meh)
<Papierkorb> `FooBar.baz`
<Papierkorb> We don't support rubys deprecated :: syntax to call class methods
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
<FromGitter> <imonmyown> @Papierkorb doesn't work for me that way 😟
<FromGitter> <jasonrobot> It still doesnt like it using the dot syntax.
<FromGitter> <jasonrobot> I get " undefined method 'baz' for FooBar:Module"
<Papierkorb> jasonrobot, `def self.baz`
<Papierkorb> imonmyown, ?
<FromGitter> <jasonrobot> that's the key then
<FromGitter> <imonmyown> I was referring to @jasonrobot 's question
<FromGitter> <jasonrobot> I've been using classes the same way. Is there any prefrence for using classes vs modues for namespacing like that?
<Papierkorb> Modules for namespacing
<Papierkorb> You can nest stuff into a class too, but if it doesn't make sense to instantiate something, make it a module
<FromGitter> <jasonrobot> sweet. Thanks a ton @Papierkorb ! I thought I was losing it for a sec there. I might look in to helping out by updating the docs tonight (I'm assuming anyone can contribute?)
<oprypin> anyone is allowed to contribute, anyway
wontruefree has joined #crystal-lang
bmcginty has quit [Ping timeout: 240 seconds]
bmcginty has joined #crystal-lang
<Groogy> @asterite you were trying the thing out before? I improved the camera controls now so bit easier to move about^^
snsei has quit [Remote host closed the connection]
<RX14> i started thinking about writing a simple minecraft clone in crystal but I have way too many sideprojects i need to do
<oprypin> lol
<Groogy> writing a simple minecraft clone is way easier than you think
<Groogy> it's kind of embarrassing
<RX14> yes but so are all of my other projects
<Groogy> true
<RX14> im just lazy
<oprypin> Groogy, i think that doing any 3d project from scratch is extremely difficult, not specific to minecraft clone
<FromGitter> <iSarCasm> Does commit history matter for a PR or its always merged as 1 commit?
<Papierkorb> Who comes up with the package names on Ubuntu?
<Papierkorb> libz.a is in .. zlib1g-dev
<Groogy> eh depends I mean. As long as you can compile a shader and render vertices
<Groogy> yo uare pretty much set for the simplest minecraft clone
<oprypin> iSarCasm, person who merges it can decide. the options are: rebase commits; rebase and squash into 1 commit; merge commits
<oprypin> iSarCasm, so my opinion on this: if you intend your PR to be merged as one commit, don't bother squashing into one commit. but if you want it to have the commit history, then you keep up the proper commit history
iSarCasm has joined #crystal-lang
<FromGitter> <iSarCasm> I think all my contributions best fit into single commit rn
<RX14> i want to write a bot for this
<RX14> you can specify your intent as to be squashed or keep history as the author
<FromGitter> <iSarCasm> So I guess I wont bother if my PR would have commit like "plese fkn work already"
<RX14> and if you use fixup commits it will handle them at merge time
<oprypin> bypassing github processes doesnt sound like a good idea
<oprypin> the pull request may even end up looking as unmerged
<iSarCasm> Hi
<RX14> well you have to if you want bors-style merges oprypin
<RX14> and i want bors-style merges
<Yxhuvud> personally I wish github had a rebase, but please *also* create a merge commit.
DTZUZU has quit [Quit: WeeChat 1.9]
<oprypin> that's silly
<Yxhuvud> (button)
gcds has joined #crystal-lang
<oprypin> it's worst of both worlds
gcds has quit [Client Quit]
<Yxhuvud> or the best of both worlds, depending on how you see it. (I also interactively rebase my commits so they contain what I want them to contain.
<oprypin> github doesnt have traceability for what has already been reviewed so it's bad to rewrite history in pull requests
<RX14> oprypin, I agree that rust's PR merges look really really ugly
<RX14> but hopefully we can do something about that
DTZUZU has joined #crystal-lang
snsei has joined #crystal-lang
jackivan88 has joined #crystal-lang
<Papierkorb> Why on earth doesn't dash's echo support the -e switch
<Papierkorb> Even better, it just acts as if -e was always present
<oprypin> Papierkorb, echo is not portable
DTZUZU has quit [Ping timeout: 255 seconds]
<oprypin> use printf in scripts
<RX14> unix makes me cry
<RX14> well, posix i guess
<Papierkorb> Fuck `dash`
<oprypin> echo "$arbitrary string" is also a bad idea because arbitrary string can be "-n"
DTZUZU has joined #crystal-lang
<Groogy> does crystal have local constants? Like only available in a function?
<RX14> local variables
<RX14> that you just dont modify
<oprypin> or private constants in a class
<RX14> if your function is too long to see if you're modifying it or not
<RX14> refactor
<Papierkorb> So, bindgen should now work on Ubuntu 16.04 too. Works on my (virtual) machine™.
<crystal-gh> [crystal] iSarCasm opened pull request #5121: Remove the possibility to require big_*. Leaving only with require "big" (master...master)
DTZUZU has quit [Ping timeout: 260 seconds]
DTZUZU has joined #crystal-lang
iSarCasm has quit [Ping timeout: 260 seconds]
alex`` has quit [Ping timeout: 255 seconds]
<crystal-gh> [crystal] akzhan opened pull request #5122: Upgrade Unicode to 10.0.0 (master...upgrade-unicode-to-10.0)
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
<watzon> Ok important question. Is there a way to determine if a crystal program was compiled with the `--release` flag from within the code?
<watzon> I want to use dotenv in development, but not require it in production
<Papierkorb> profit:
<Papierkorb> watzon: Try `{% flag?(:release) %}`
<Papierkorb> `{% if flag?(:release) %}` *
<RX14> i'd say thats bad design personally
<RX14> i'd prefer to make it a runtime decison not compile-time
<RX14> based on ENV vars
<RX14> compiling using --release in development is often useful
<Papierkorb> Hopefully more helpful error message than before now when generating Qt5 bindings with missing deps:
wontruefree 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]
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]
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]
maxpowa has quit [Ping timeout: 255 seconds]
wontruefree has quit [Read error: Connection reset by peer]
wontruefree has joined #crystal-lang
baweaver_away is now known as baweaver
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
<watzon> Good points RX14
wontruefree has joined #crystal-lang