ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.29.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
nullnullnull has joined #crystal-lang
<FromGitter> <kniknoo> I think that sounds like a good strategy, minus the low self-expectations.
<FromGitter> <kniknoo> I still have some stuff to fill out and set up, but I'd be grateful for anyone willing to give feedback on how I'm writing https://github.com/kniknoo/ddate/tree/master/src ⏎ It's short, to the point, and documented, I just wanna get feedback on my style before I write something bigger.
<FromGitter> <meltheadorable> its not about my self-expectations, if anyone in the world wanted to write SMTP servers, there would be more of them out there, but everyone is just layering stacks of plugins and weird hacks on top of like, three of them, and crossing their fingers
<FromGitter> <dscottboggs_gitlab> oof
<FromGitter> <dscottboggs_gitlab> why is the ecosystem so bad?
<FromGitter> <meltheadorable> because email is a dinosaur and stateful line-based protocols are annoying
<FromGitter> <kniknoo> Understood, here we have the opportunity to help re-imagine such things. :)
<FromGitter> <kniknoo> I don't envy you, I don't like to even deal with simple Email stuff.
<FromGitter> <meltheadorable> there’s a couple other reasons — and i suspect like, google and amazon did write their own
alex`` has quit [Ping timeout: 244 seconds]
<FromGitter> <dscottboggs_gitlab> TBH parsing a stateful line-based proto in crystal doesn't sound so bad. It's the extensions that worry me, but as long as it all can implement a common interface....I know a lot of people hate those kinda problems but I really like them. ⏎ ⏎ Also, just because email is a dinosaur doesn't mean it's bad.
<FromGitter> <meltheadorable> i’m just saying that’s why there’s not much interest
<FromGitter> <meltheadorable> or part of it
<FromGitter> <dscottboggs_gitlab> I think an app which acted like a modern chat app but which was based on GPG-encrypted emails would be awesome
<FromGitter> <kniknoo> I like that idea. :)
<FromGitter> <meltheadorable> https://www.coi-dev.org/
<FromGitter> <dscottboggs_gitlab> Oh. I see.
<FromGitter> <meltheadorable> i have very serious reservations about it
<FromGitter> <meltheadorable> and it’s not encrypted by default AFAIK
<FromGitter> <kniknoo> I'm looking forward to a chat about security considerations once I get a little deeper in.
<FromGitter> <meltheadorable> i think OTR would be better than GPG for this case too
<nullnullnull> TCPSocket.new("google.com",80)
<nullnullnull> how to add timeout to this socket?
<nullnullnull> max timeout to connect
<FromGitter> <meltheadorable> supply a `connect_timeout` argument to new? https://crystal-lang.org/api/0.29.0/TCPSocket.html#new%28host%2Cport%2Cdns_timeout%3Dnil%2Cconnect_timeout%3Dnil%29-class-method
<nullnullnull> oh thanks mate :) so it's like this TCPSocket.new("google.com",80,"",2)
<FromGitter> <kniknoo> God I love this language
<nullnullnull> I just started learning crystal :P
<FromGitter> <watzon> nullnullnull you better change your name to nilnilnil then ;)
<FromGitter> <kniknoo> Welcome aboard! I'm only about a month in.
<nullnullnull> :D
<FromGitter> <meltheadorable> alternatively `TCPSocket.new(host: “google.com”, port: 80, connect_timeout: 2)`
<FromGitter> <watzon> In all seriousness though, welcome :)
<nullnullnull> hmmm nice :)
<FromGitter> <meltheadorable> i prefer specifying the argument names that way most of the time
<FromGitter> <meltheadorable> you can also mix and match and only name the timeout argument
<FromGitter> <meltheadorable> `TCPSocket.new(“google.com”, 80, connect_timeout: 2)`
<nullnullnull> I started to like this language
<FromGitter> <kniknoo> Null, you have a Ruby background at all?
<FromGitter> <dscottboggs_gitlab> > i think OTR would be better than GPG for this case too ⏎ ⏎ I don't really know a ton about either, what would make OTR better?
<nullnullnull> I dont have a ruby background but Python, Java, C#
<FromGitter> <dscottboggs_gitlab> > it’s not encrypted by default AFAIK ⏎ ⏎ WTF
<FromGitter> <watzon> Grrr this is so f*cking frustrating
<FromGitter> <dscottboggs_gitlab> nullnullnull I came from python as well
<FromGitter> <dscottboggs_gitlab> i've barely written any ruby
<FromGitter> <kniknoo> Excellent! Get ready to have your brain broken by lots of beautiful syntactic sugar!
<FromGitter> <watzon> I'm trying to create a transport to work with Firefox Marionette and I can't find the message format defined anywhere
<FromGitter> <dscottboggs_gitlab> TBF python has some decent syntax sugar as well
<FromGitter> <watzon> We all know my feelings about Python 😬
<FromGitter> <watzon> I'll leave it there
<FromGitter> <dscottboggs_gitlab> see my implementation of the `delegate` Crystal feature in Python https://github.com/dscottboggs/python-delegate :p
<FromGitter> <kniknoo> It does. I really adore the object definitions though and the way you can make assumptions about objects, for instance.
<nullnullnull> btw, just a general question: why there are so many languages? why they dont make just one good language for everything
<FromGitter> <watzon> Because no prefect language exists
<FromGitter> <dscottboggs_gitlab> we're still evolving the concept of the programming langauge in general
<FromGitter> <kniknoo> Because not enough people have drank the crystal kool-aid yet....
<nullnullnull> hmm
<nullnullnull> so what for example crystal got over python? (I'm new to crystal)
<FromGitter> <kniknoo> Er, yeah, that. Linguistics is a complex topic.
<FromGitter> <dscottboggs_gitlab> even if we come up with a REALLY good language, it seems likely that there will be multiple languages for different purposes
<FromGitter> <dscottboggs_gitlab> Crystal has about 10-100x speed over python with approximately the same or even better developer productivity
<FromGitter> <kniknoo> Well... you only have to say "self" when you really want to say "me, this thing here" and not have to define yourself to yourself and everyone else all the time.
<nullnullnull> ah you mean performance right?
<FromGitter> <kniknoo> The object interaction can be almost poetic and English if you set up your methods and arguments the right way.
<FromGitter> <kniknoo> Performance is amazing!
<FromGitter> <watzon> Crystal's performance is massively better than Pythons
<FromGitter> <dscottboggs_gitlab> TBH there are things about Crystal I would change, but I think it's a really important step along the evolution of programming languages and as far as the langauges that exist right now it is far and away one of the best.
<FromGitter> <watzon> Same ^
<FromGitter> <kniknoo> Optimization via LLVM is possible. I can count to 1billion and add up every number along the way in well under a millisecond.
<nullnullnull> + cool community :P (so far)
<FromGitter> <Blacksmoke16> Don't forget single binary
<FromGitter> <kniknoo> Even a hard to optimize program like generating a random string and pulling out the palindomes can be pretty quick. I was getting about 17 seconds for 100,000,000 cycles.
<FromGitter> <dscottboggs_gitlab> It's not just performance, though, nullnullnull. Most languages are a tradeoff between being able to write code quickly and being able to write code that runs quickly. Crystal is not. You get code that runs fast and you can develop it very quickly. You get scripting-language level APIs in a language with access to systems level APIs
<nullnullnull> ah thanks for info mate :) so it's about production speed, easy of use, performance
<FromGitter> <dscottboggs_gitlab> yup
<FromGitter> <watzon> Yeah, Crystal isn't perfect, but personally I think it's the closest thing we have now
<FromGitter> <watzon> There are definitely still some things missing
<FromGitter> <Blacksmoke16> Don't forget single binary ^
<FromGitter> <kniknoo> I just posted a DDate I made in nearly a line-to-method ratio. I'm about to tackle a simple Virtual Machine that I expect will only take me about 50 lines to get an interpreter and ADD/LOAD/HALT implemented.
<FromGitter> <watzon> Like multithreading
<FromGitter> <meltheadorable> @dscottboggs_gitlab i mean it’s got transport layer encryption assuming you’re using TLS, but COI is more a spec than an implementation, and there’s not a protocol for E2E encryption yet, most chat services don’t have it and E2E encryption would break functionality like search and make the email fallback unreadable so there’s tradeoffs
<FromGitter> <dscottboggs_gitlab> TBH single binary can be seen as a disadvantage to some because it comes with the implication that source code of all dependencies must be known at compile time
<FromGitter> <watzon> @kniknoo I did that and that's about what it took for me
<FromGitter> <watzon> Built a little state machine in 40-50 lines
<FromGitter> <kniknoo> I'm finding that I can translate from both C and Ruby pretty readily, fortunately I can make just enough of the C that I recognize an algorithm I can implement.
<FromGitter> <dscottboggs_gitlab> > E2E encryption would break functionality like search and make the email fallback unreadable so there’s tradeoffs ⏎ ⏎ The Signal project came up with an algorithm for allowing users to search for their contacts without exposing that information. If it can check if the user is a member of COI why can't it use that to determine whether or not to use E2EE?
<FromGitter> <kniknoo> Nice! I'm going to implement the TIS-100 spec and see how easily I can make the game from there. I'm gonna use crystal spec to implement the test-based gameplay.
<FromGitter> <meltheadorable> The main things I want from crystal are: ⏎ ⏎ 1) GUI please ⏎ 2) Good way to do release packaging for different OSes (including as-static-as-possible binaries) ⏎ 3) Ability to create shared libraries that export C functions ... [https://gitter.im/crystal-lang/crystal?at=5d40e2622009b770a0becda1]
<FromGitter> <meltheadorable> 1 & 2 will probably come eventually, 3 & 4 will probably not
<FromGitter> <watzon> Agreed. Multi-threading is also a must have
<FromGitter> <meltheadorable> not in a practical way at least
<FromGitter> <watzon> Which apparently might be coming very soon
<FromGitter> <dscottboggs_gitlab> @kniknoo C can actually be translated directly into Crystal. All the C primitives are available as Crystal primitives.
<FromGitter> <kniknoo> Yep, we're gonna need to find a GUI geek amongst us. ⏎ I'll think on the packaging, I have feelings about this. ⏎ ⏎ 1) .. why not? [https://gitter.im/crystal-lang/crystal?at=5d40e2afc4aca715b2887913]
<FromGitter> <meltheadorable> I’m trying to design a language too but it’ll be much more niche
<FromGitter> <kniknoo> Oh, what do you have in mind?
<FromGitter> <kniknoo> TIS-100 is mainstream now...?
<FromGitter> <meltheadorable> not more niche than TIS-100 haha more niche than crystal
dingenskirchen has quit [Ping timeout: 250 seconds]
<FromGitter> <watzon> Ok someone that is good with Python, can I get some eyes on this (https://searchfox.org/mozilla-central/source/testing/marionette/client/marionette_driver/transport.py#72) to tell me what the expected output would be for `send("WebDriver:Navigate", {url: "https://google.com"})`
<FromGitter> <kniknoo> Oh, ok. :) I was going to learn to build a lexer and all that, I'm excited that I can work with an ASM concept before I try a high level language.
<FromGitter> <watzon> I'm pretty sure it should be `<Command id=1, name=WebDriver:Navigate, params={\"url\":\"https://google.com\"}>`
<FromGitter> <meltheadorable> I wanna design a language that’s better and friendlier than C specifically targeting old game consoles and embedded bare-metal platforms with memory-mapped IO and no operating system
<FromGitter> <kniknoo> Ooooh, I like!
<FromGitter> <meltheadorable> C is actually really hard to compile for some old systems, they’re register starved and none of the modern optimizations work, so “better than C” for those use cases is not actually absurd
<FromGitter> <kniknoo> Well... that's not a far jump from starting to learn from an MCU based LLVM target, like the AVR I was talking yesterday.
<FromGitter> <meltheadorable> my initial target is intended to be either the gameboy or a VM i’m designing to be slightly less quirky than a gameboy 😂
<FromGitter> <dscottboggs_gitlab> @meltheadorable could you use LLVM for that or would you need to do ASM directly?
<FromGitter> <kniknoo> I was ... actually shocked... to learn the other day that NES was C. I thought for sure they'd have a proprietary ASM they used.
<FromGitter> <meltheadorable> @dscottboggs_gitlab LLVM wouldn’t be useful, I thought about it but I’d need to write new LLVM backends as well for processor targets like these, might as well skip the middleman initially
<FromGitter> <meltheadorable> NES games were all written in ASM
<FromGitter> <dscottboggs_gitlab> aw jeeze
<FromGitter> <dscottboggs_gitlab> that's tough
<FromGitter> <kniknoo> I think with a working modern MCU, we can study the pinout of the 6502, or whatever it is, and start to work out a driver.
<FromGitter> <kniknoo> from LLVM
<FromGitter> <meltheadorable> @kniknoo where did you hear that the NES was C?
<FromGitter> <kniknoo> Ok. Good... in my head video games seem like they're easier in ASM than C, but I'm crazy.
<FromGitter> <kniknoo> Programming Showdown, but they get a lot wrong, so I'm not surprised.
<FromGitter> <meltheadorable> AFAIK the first nintendo platforms that had games in them regularly written in C were the gameboy advance and n64
<FromGitter> <meltheadorable> pokemon ruby and sapphire were compiled with an ancient version of GCC actually, packaged by a 3rd party company
<FromGitter> <kniknoo> I tend to imagine that Exapunks gives an ok starter concept of what game assembly is like, minus the fantasy objects of course.
<FromGitter> <meltheadorable> and n64 had some kind of MIPS processor with a very esoteric compiler
<FromGitter> <meltheadorable> iirc
<FromGitter> <kniknoo> Nice! MIPS is on my exercism queue. It doesn't look too bad.
<FromGitter> <meltheadorable> i don’t personally like dealing with asms much, but some asms are better than others
<FromGitter> <meltheadorable> ARM assembly is really annoying
<FromGitter> <meltheadorable> but the z80 dialect running on the gameboy’s sharp something-or-other processor is alright
<FromGitter> <dscottboggs_gitlab> @watzon I'm looking at your python and just confused by your question
<FromGitter> <watzon> I actually linked to the wrong line
<FromGitter> <dscottboggs_gitlab> ah, that'll do it
<FromGitter> <watzon> But basically I'm trying to figure out what this payload (https://searchfox.org/mozilla-central/source/testing/marionette/client/marionette_driver/transport.py#242) will end up looking like when it gets sent to the socket
<FromGitter> <watzon> I know it has the format `message_length:message_content`
<FromGitter> <kniknoo> I got an LED to blink in ARM assembly after a week. It hurt my brain.
<FromGitter> <watzon> But I'm having a hard time figuring out what the `json.dumps(obj)` is going to return
<FromGitter> <dscottboggs_gitlab> is there any reason you can't use PDB andd break on that line?
<FromGitter> <tenebrousedge> @kniknoo code looks fine to me 👍
<FromGitter> <kniknoo> Thank you for checking it out!
<FromGitter> <dscottboggs_gitlab> ☝️ July 30, 2019 8:47 PM (https://gitter.im/crystal-lang/crystal?at=5d40e50a20f75e7ba556f168) ouch
<FromGitter> <watzon> I'm not actually running it locally haha, just trying to build something similar
<FromGitter> <watzon> But I think I may have an idea
<FromGitter> <watzon> I got it!
<FromGitter> <dscottboggs_gitlab> Nice!
<FromGitter> <watzon> I was way over thinking things
<FromGitter> <dscottboggs_gitlab> hate that
lucasb has quit [Quit: Connection closed for inactivity]
<FromGitter> <tenebrousedge> so I'm working on some random practice problems, in Ruby, and trying to come up with something that will list cyclic primes (https://oeis.org/A068652) (Wikipedia (https://en.wikipedia.org/wiki/Circular_prime)). It's selecting 179 as a cyclic prime, which seems sensible, but I can't find anywhere that actually lists 179 as a circular prime. Am I crazy or is my code wrong, or both, or neither? ⏎ ⏎
<FromGitter> ... ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d40e76f51d80b6c6504b52f]
<FromGitter> <tenebrousedge> produces: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d40e7b102abe16c6486b5a2]
<FromGitter> <watzon> 179 is a circular prime
<FromGitter> <tenebrousedge> ``` (0...3).all? {|i| Prime.prime? 179.digits.rotate(-i).join.to_i } ⏎ #=> true``` [https://gitter.im/crystal-lang/crystal?at=5d40e9661dc3324670d679e0]
<FromGitter> <tenebrousedge> what am I missing?
<FromGitter> <tenebrousedge> 791
<FromGitter> <tenebrousedge> but then why isn't the `select` working?
<FromGitter> <bajro17> @watzon I have question about your tree implementation
<FromGitter> <bajro17> why size return 5 when I write "test"
<FromGitter> <watzon> You're talking about `Cadmium::Tries`?
<FromGitter> <bajro17> Yes
<FromGitter> <bajro17> I make new instance
<FromGitter> <bajro17> a = Trie.new
<FromGitter> <bajro17> a.add("test")
<FromGitter> <bajro17> puts a.size
<FromGitter> <bajro17> and I get 5
<FromGitter> <meltheadorable> `.digits` seems to reverse the digits for some reason, so it’s rotating wrong @tenebrousedge `179.digits` returns `[9, 7, 1]` so it never rotates to `791` , i have no idea why it does that
<FromGitter> <meltheadorable> `179.digits.reverse.rotate…` should do what you want
<FromGitter> <meltheadorable> Ahh…`.digits` seems specifically for extracting them in place value notation…that’s surprising
<FromGitter> <watzon> Well size returns the number of nodes, not the number of characters. Tbh I don't know off the top of my head why there would be 5 nodes after adding 4 characters though
<FromGitter> <Daniel-Worrall> I would imagine the calculations are iterative starting from the lowest unit for efficiency which is why it's coming out "the wrong way"
<FromGitter> <tenebrousedge> @meltheadorable well, that explains that, but now my head hurts
<FromGitter> <tenebrousedge> so reversing the `digits` array it makes the code work
<FromGitter> <tenebrousedge> good show
<FromGitter> <tenebrousedge> thanks
<FromGitter> <meltheadorable> ofc
teardown has quit [Read error: Connection reset by peer]
nullnullnull has quit [Quit: Leaving]
return0e has quit [Ping timeout: 248 seconds]
laaron has joined #crystal-lang
teardown has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron- has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
fyber has joined #crystal-lang
<FromGitter> <watzon> Has anyone seen this? `Unhandled exception: Unexpected char '' at 1:8186 (JSON::ParseException)`
<FromGitter> <watzon> I guess JSON can't parse zero width characters?
_ht has quit [Ping timeout: 246 seconds]
<FromGitter> <watzon> Oh, it's looking like you can only read so much data from a socket at one time
<FromGitter> <andrius> Good morning. Is it possible to get somehow spec/properties of fields declared with JSON::Mapping? In my app, I do receive JSON from AMQP which serialise to the actual data using `from_json`, but also I have to populate my data package specs to the API in JSON format. It is similar to swagger spec. ⏎ ⏎ If app receive `{"name": "foo"}`, the spec that initially shall be populated could look like `{"name":
<FromGitter> ... {"type": "string"}}`
alex`` has joined #crystal-lang
laaron- has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<FromGitter> <watzon> You can declare a mapping using a constant hash instead of doing it directly inside of the macro. That way you have a hash of fields
<FromGitter> <watzon> ```FIELDS = { .. } ⏎ JSON.mapping(FIELDS)``` [https://gitter.im/crystal-lang/crystal?at=5d41305b3e05746cc8981062]
<FromGitter> <andrius> thank you!
<FromGitter> <andrius> failed. FIELDS should be an NamedTuple or Hash? https://play.crystal-lang.org/#/r/7bs1
<FromGitter> <watzon> Oh right, it needs to look like this
<FromGitter> <watzon> ```FIELDS = { .. } ⏎ JSON.mapping({{FIELDS}})``` [https://gitter.im/crystal-lang/crystal?at=5d41365445775115b36fe949]
<FromGitter> <andrius> worked only with constant ⏎ https://play.crystal-lang.org/#/r/7bsb
sagax has quit [Remote host closed the connection]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <watzon> I've got Marionette taking screenshots 🍻
<FromGitter> <watzon> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d413cc902abe16c64890053]
<FromGitter> <watzon> Not very pretty yet, but it works
<FromGitter> <watzon> Tomorrow I'll be wrapping it all into a nice API
<FromGitter> <andrius> sounds similar to selenium
blassin has quit [Quit: Ping timeout (120 seconds)]
blassin has joined #crystal-lang
<FromGitter> <watzon> It is, but better because it doesn't have the Java overhead
<FromGitter> <watzon> It interfaces directly with a running Firefox instance
<FromGitter> <absolutejam_gitlab> How feasible is it to embed file(s) into my compiled binary?
<FromGitter> <absolutejam_gitlab> I've seen https://github.com/schovi/baked_file_system
<FromGitter> <absolutejam_gitlab> I just want to slurp up a dir (or tar if that's easier) and dump it out on first run of the binary
<FromGitter> <absolutejam_gitlab> also, `YAML.mapping` is freaking amazing
<FromGitter> <naqvis> should be doable, but I would have preferred having writing some in-memory `Filesystem` via which you can interact with embedded data as you do with normal `OS::FileSystem`
<FromGitter> <naqvis> For quick reference on embedding data, refere to Go (bin-data)[https://github.com/go-bindata/go-bindata]
dingenskirchen has joined #crystal-lang
dingenskirchen has quit [Remote host closed the connection]
dingenskirchen has joined #crystal-lang
sorcus has joined #crystal-lang
ht_ has joined #crystal-lang
<FromGitter> <andrius> https://play.crystal-lang.org/#/r/7bve, it is possible to get it looking better (I am asking about lines 13 and 14). The goal is to get shared data declared for JSON mappings between different instances
<FromGitter> <andrius> Ideally I would like just to write `spec blah`
sagax has joined #crystal-lang
<FromGitter> <absolutejam_gitlab> jesus christ this is some ugly magic
<FromGitter> <absolutejam_gitlab> but I don't have time to figure this out well
<FromGitter> <absolutejam_gitlab> (yet)
<FromGitter> <absolutejam_gitlab> `{{ system("tar -czf ./foo.tar.gz .assets") }}`
<FromGitter> <absolutejam_gitlab> then using `baked_file_system` to slurp it up
<FromGitter> <absolutejam_gitlab> and then a function that writes it to disk and untars it at runtime
return0e has joined #crystal-lang
<FromGitter> <straight-shoota> @absolutejam_gitlab You don't necessarily need to tar and zip your files. `BakedFileSystem#bake_folder` can already read an entire folder, and files are compressed anyway.
<FromGitter> <straight-shoota> Compressing it outside of `BakedFileSystem` could help improve compile speed, if you don't need to compress it for every build
<FromGitter> <absolutejam_gitlab> It complained at me that the `bake_folder` didn't contain files
<FromGitter> <absolutejam_gitlab> I guess it's because it contains subdirs
<FromGitter> <naqvis> @absolutejam_gitlab add `allow_empty: true` to `bake_folder` call
<FromGitter> <andrius> Curious why there is no option to put unknown data to the hash? https://github.com/crystal-lang/crystal/blob/master/src/json/mapping.cr#L149
<FromGitter> <absolutejam_gitlab> can I cross-compile for a mac from linux?
<FromGitter> <absolutejam_gitlab> because all of my CD is on Linux...
flaviodesousa has quit [Quit: KVIrc 4.9.3 Aria http://www.kvirc.net/]
flaviodesousa has joined #crystal-lang
laaron has quit [Remote host closed the connection]
<FromGitter> <j8r> you want to test on macOS, better to compile it on macOS then
laaron has joined #crystal-lang
<FromGitter> <absolutejam_gitlab> I'm testing on macOS
<FromGitter> <absolutejam_gitlab> but my deployment will be done with a CD pipeline
<FromGitter> <absolutejam_gitlab> feels a bit hacky pushing up changes to be built then having to manually push the built MacOS build
<FromGitter> <j8r> Circle CI, used by Crystal Lang, can have macOS
<FromGitter> <absolutejam_gitlab> We use our own runners internally 😬
<FromGitter> <absolutejam_gitlab> in kubernetes
<FromGitter> <j8r> there is also https://cirrus-ci.org/faq/
<FromGitter> <j8r> one option is to use an external service for
<FromGitter> <absolutejam_gitlab> Is there no way to cross-compile to macOS at all, atm?
<FromGitter> <j8r> you can
<FromGitter> <j8r> but you need a macOS host to link
<FromGitter> <absolutejam_gitlab> is there no way around that?
<FromGitter> <j8r> not at the moment
<FromGitter> <absolutejam_gitlab> How do Rust and Golang do it?
<FromGitter> <absolutejam_gitlab> or do they have their own tooling to do so?
<FromGitter> <j8r> it isn't possible to spawn a VM with Kubernetes, instead of a container?
<FromGitter> <absolutejam_gitlab> It's all hosted in GCP atm and AFAIK you can only run macOS VMs on macOS
<FromGitter> <absolutejam_gitlab> I have a Macbook, so I can do it manually, it's just not the most ideal
<FromGitter> <j8r> for sure :/
<FromGitter> <j8r> what about https://kubevirt.io/?
<FromGitter> <Blacksmoke16> the section about `JSON::Serializable::Unmapped`
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
duane has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
lucasb has joined #crystal-lang
laaron has quit [Remote host closed the connection]
<sorcus> Hi all. Can someone tell me, why compiled binary works on laptop (where compiled), but not on server.
<sorcus> Where uacme_hook_knot - is a binary. /usr/bin/uacme_hook_knot
<sorcus> On server i got uacme: uacme_hook_knot: No such file or directory
laaron has joined #crystal-lang
<sorcus> https://github.com/ndilieto/uacme/ - uacme client.
<sorcus> https://github.com/ndilieto/uacme/blob/master/uacme.c#L333 - line, where uacme_hook_knot called.
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <naqvis> doesn’t seem binary issue, but more of permissions issue
<FromGitter> <naqvis> ensure binary has `executable` flag on, as well as user via which that program is running has enough privileges on same executable
<sorcus> User is root. `chmod +x /usr/bin/uacme_hook_knot` doesn't help.
<sorcus> > -rwxr-xr-x 1 root root 331K Jul 31 13:43 /usr/bin/uacme_hook_knot
laaron has quit [Remote host closed the connection]
<FromGitter> <naqvis> can you ensure, that you can run that manually?
<FromGitter> <absolutejam_gitlab> I've had it when trying to run a binary on Alpine vs. Ubuntu
<FromGitter> <absolutejam_gitlab> Is it to do with the libs they use?
laaron has joined #crystal-lang
<FromGitter> <j8r> @absolutejam_gitlab sorcus use `crystal build --static` for static linking
<sorcus> naqvis: I can run it on laptop. But not if i move binary to server.
<sorcus> j8r: Static linking works only on Apline, not on Archlinux.
<FromGitter> <kniknoo> My next step would be to see if it's running in a fresh local VM and diagnose without the extra server in the way.
<FromGitter> <kniknoo> So that is still the case? I was wondering with people suggesting the --static flag. Perhaps Alpine on a VM? I should try that as well, I already have one set up just to see what it was about.
<FromGitter> <Blacksmoke16> alpine with docker
<FromGitter> <Blacksmoke16> can mount the files into the container, build in container, and output the binary
<FromGitter> <kniknoo> Errr, derp yeah. Perfect.
<FromGitter> <j8r> LXC, LXD, KVM, chroot, Docker - you have the choice
<sorcus> And why command `uacme -h uacme_hook_knot` or system("uacme -h uacme_hook_knot") and `uacme -h /usr/bin/uacme_hook_knot` depends on environment?
<FromGitter> <kniknoo> Blacksmoke, you have any experience with snaps yet? It's on my list to learn.
<sorcus> j8r: Yeah, i use LXC...
<FromGitter> <Blacksmoke16> a bit yea, with the `oq` stuff
<FromGitter> <j8r> sorcus that's the crystal app that depends on system libraries
<FromGitter> <kniknoo> I'll likely be hitting you up with some questions once I'm in the mood for packaging.
<FromGitter> <j8r> use `ldd` to see which ones
<FromGitter> <Blacksmoke16> 👍
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
<FromGitter> <j8r> hum wait, not sure we are talking about the same issue
<FromGitter> <j8r> have you compiled your `test.cr` inside the same machine?
laaron has joined #crystal-lang
<sorcus> Move binary to server
<sorcus> j8r: Sorry, english is not my mother tongue.
<FromGitter> <kniknoo> God I love this language! The one part of writing a VM that I didn't fully understand from the C source translates without change. Memo to self, get proficient with bitwise operators.
<FromGitter> <naqvis> can you check if binary `uacme_hook_knot` is in path?
<FromGitter> <naqvis> seems `uacme` is in path, while your binary isn't
<FromGitter> <naqvis> i would have done the test by `hardcoding` the binary path and see what error i receive
<sorcus> naqvis: i tried `uacme -h /usr/bin/uacme_hook_knot` but got similar issue.
<FromGitter> <naqvis> ```pp `which uacme_hook_knot````
<FromGitter> <j8r> sorcus so that's not a problem with static linking
<sorcus> naqvis: "/usr/bin/uacme_hook_knot\n"
<FromGitter> <j8r> your are executing as root?
<sorcus> j8r: Yeap..
<FromGitter> <j8r> maybe that's an error of the `uacme` binary, not finding the other one
<FromGitter> <naqvis> yeah, agree. sorcus can you directly try to invoke the binary? for testing purpose skip invoking that via `uacme`
<FromGitter> <j8r> what does `echo $PATH` return?
<FromGitter> <naqvis> and see if you see some problems, if executable works, that shows its working fine, you should see why `uacme` is uanble to find
<sorcus> j8r: /usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
<FromGitter> <j8r> ok... don't know then
<sorcus> naqvis: pp `uacme_hook_knot` - works on both.
<FromGitter> <naqvis> so that validates, compiled binary does work on server.
<FromGitter> <naqvis> now plz. try to investigate into `uacme` code-base on why it is unable to find this binary
<FromGitter> <kniknoo> Is there a matter of who is crystal is running as? I see you saying you need a root invocation but `whoami` shows my regular user.
<FromGitter> <naqvis> nope, `crystal compiled` binaries are just binaries, don’t require any specific privileges, provided you are not trying to do some action in binary which does require specific privileges
<FromGitter> <kniknoo> actually, I'm gonna go look at a few things just for my own understanding. Alright, noted, just a thought.
<FromGitter> <kniknoo> Cool, as I assumed. I just wrote a one liner to return whoami and it does change the agent. (I'm still a n00b to my own binaries, I couldn't assume yet)
<sorcus> naqvis: Ok, i think a better way is an ask about this issue uacme's developer.
<sorcus> naqvis, j8r thanks a lot.
duane has quit [Ping timeout: 246 seconds]
<FromGitter> <naqvis> you are welcome sorcus
laaron- has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
sagax has quit [Remote host closed the connection]
laaron- has quit [Remote host closed the connection]
duane has joined #crystal-lang
duane has quit [Remote host closed the connection]
<sorcus> naqvis: https://gist.github.com/MrSorcus/65f591d87ace361f1edbeb151cd6578e - with python similar issue... Looks like a problem in uacme.
<FromGitter> <naqvis> just a second thought, can you write a simple shell script with echo and have `uacme` call that?. I just looked into `uacme` github page and by default it is calling the shell script. If script calling work, just update the script and invoke your binary inside that script
<FromGitter> <naqvis> won’t hurt to give it a try
Stephie has joined #crystal-lang
RX14 has left #crystal-lang ["Leaving"]
duane has joined #crystal-lang
<FromGitter> <naqvis> what I mean’t was like sth like this ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d41c325395d5d4671fde43e]
<sorcus> naqvis: I don't understand... Now with -h /usr/bin/uacme_hook_knot it works... WTF? O_o
<FromGitter> <naqvis> 👏 as long as it works
<FromGitter> <naqvis> that’s good
melthelesbian has joined #crystal-lang
<FromGitter> <kniknoo> SUCCESS!!!! I have a rudimentary bytecode VM that can load, add, and halt in 39 lines so far.
<FromGitter> <kniknoo> I really wish one-liner defs were style-legal according to format...
<FromGitter> <naqvis> @kniknoo Bravo
<FromGitter> <kniknoo> Thank you!
<FromGitter> <kniknoo> I'm gonna do some refactoring for nicer names and I'll share for feedback shortly.
<sorcus> kniknoo: Congrats :-)
<sorcus> naqvis: Ok, i got "uacme: uacme_hook_knot: No such file or directory" again... %-)
<sorcus> Or not. I'm confused.
Stephie has quit [Quit: Fuck this shit, I'm out!]
<sorcus> naqvis: That strange, but it works now...
Stephie has joined #crystal-lang
dingenskirchen has quit [Ping timeout: 246 seconds]
sagax has joined #crystal-lang
<FromGitter> <meltheadorable> what machine are you virtualizing?
<FromGitter> <kniknoo> I'm just starting with the bare basics, using https://en.wikibooks.org/wiki/Creating_a_Virtual_Machine/Register_VM_in_C as a guide. From here I'm going to try to implement all the TIS-100 instructions, meaning I'll only have an ACC and BAK for registers.
<FromGitter> <kniknoo> There was a nice Z-80 based machine in that list you sent me, I'm going to study it once I'm happy with my toy idea here.
<rkeene> ELVM might be good to look at as well ;-)
<FromGitter> <kniknoo> Thank you! that looks like fun!
<FromGitter> <kniknoo> I also wouldn't mind building something like this. http://pelulamu.net/ibniz/ I'm surrounded by visual glitch artists who would love some custom tools.
<FromGitter> <meltheadorable> A lot of people do https://en.wikipedia.org/wiki/CHIP-8 as a first foray into this
<FromGitter> <meltheadorable> a search for “chip-8 emulator” will give you like 20 articles
<FromGitter> <kniknoo> Nice, I'm reading the wiki article, especially with that pseudo-code there it shouldn't be too difficult. I was wanting to learn how to do timers anyway!
<FromGitter> <kniknoo> I presume I need something like SDL as a visual backend... unless of course I want to represent sprites in ANSI...
<FromGitter> <meltheadorable> just got my first mechanical keyboard, it is very disconcerting
<FromGitter> <kniknoo> eek, I don't understand them.
<FromGitter> <denolfe> Mechanical keyboards are a very deep rabbit hole. Run while you still can
<FromGitter> <meltheadorable> it’s not that deep a rabbit hole because there’s only like 3 that are designed for macs
<FromGitter> <meltheadorable> so there’s not much risk i’ll keep falling down it
<FromGitter> <denolfe> So you haven't gone down the building a custom keyboard rabbit hole yet :P
<FromGitter> <kniknoo> I could see myself making one out of an Arduino. Just as long as I can keep the keys silent.
<FromGitter> <meltheadorable> Nah, and I don’t think that’s even viable — I’m a little disappointed in this one actually
dingenskirchen has joined #crystal-lang
<Stephie> haha, i just bought a cheap one on amazon
<Stephie> i'm fairly limited by the few mech keyboards which are ISO layout instead of ANSI
<Stephie> it's cheap knockoff MX blue clones but hey, it's clicky and it works and it doesn't look toooo bad
<rkeene> It looks similar to one I bought on Amazon.com
<Stephie> any keyboard is a "mac" keyboard, it just needs the right keycaps :P
<Stephie> mine are blank, so, it's agnostic haha
<FromGitter> <meltheadorable> stephie that’s not true — key placement is really critical, you can’t just replace the windows key with the command key and call it a day, on mac keyboards the command key is further to the right and wider so that it’s an easier target from the home row, and the function/media keys all do things, if you just use a windows keyboard or a keyboard with blank keycaps, all your keyboard shortcuts are
<FromGitter> ... a pain in the ass
<FromGitter> <tjbarber> I dunno, I just use a Microsoft keyboard with my Mac. Seems good enough :P
<FromGitter> <meltheadorable> unfortunately this one didn’t do that either so i had to remap some keys and im trying to get used to it but a proper mac mechanical keyboard would change the layout more significantly
<Stephie> the ketchrom k2 seems to have the same layout in the control, option, command group as my "windows" keyboard
<Stephie> keychron*
<FromGitter> <meltheadorable> it does, but it’s got working media keys at least
<Stephie> fair enough
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 244 seconds]
<FromGitter> <watzon> Wooo! This is what marionette's API now looks like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d41f0ebc4aca715b29046ac]
<FromGitter> <watzon> Still lots of work to do, but I've made some serious progress
<FromGitter> <watzon> Bye bye Selenium
<sorcus> watzon: Very cool.
<FromGitter> <absolutejam_gitlab> so many useful methods
<FromGitter> <absolutejam_gitlab> I started writing a way to iterate of characters and turn camel case to snake case and then I found `.underscore`
<FromGitter> <watzon> Lol yeah, there are some transformations missing, but there are a couple there
<FromGitter> <meltheadorable> @watzon hrm!
<FromGitter> <watzon> hrm? Lol
<FromGitter> <jwoertink> Is there a way to get the base class name from a `@type` in a macro aside from doing `@type.name.split("::").last`?
<FromGitter> <meltheadorable> @watzon like interesting but unsure how to feel about it ^_^;;;;;;
<FromGitter> <watzon> @meltheadorable why is that? Lol
<FromGitter> <asterite> @jwoertink I don't think so
<FromGitter> <watzon> It's basically Selenium, but faster and with less overhead
<FromGitter> <jwoertink> cool. Thanks!
<FromGitter> <jwoertink> @watzon that looks awesome!
<FromGitter> <meltheadorable> @watzon not sure! keeping an eye out, though — i have mixed feelings about many things, looking forward to seeing where it goes ^_^
<FromGitter> <jwoertink> I just wrote a ruby app to do some stuff using Watir. Maybe I can move over to crystal now :D
<rkeene> I mis-read that as Waitr and was real confused
<FromGitter> <watzon> This is going to be an important project for NeuraLegion. I'm really happy that they're allowing me to work on my personal projects as my job now ^.^
<FromGitter> <meltheadorable> @watzon what are the chances of you allowing `launch` to take a block that will automatically terminate the browser instance at the end of it?
<FromGitter> <j8r> what browsers does it support @watzon ?
<FromGitter> <watzon> @meltheadorable I fully plan on it
<FromGitter> <meltheadorable> nice
<FromGitter> <meltheadorable> think i’d feel better about that API
<FromGitter> <meltheadorable> tidy
<FromGitter> <watzon> @j8r for now it's just going to be Firefox using the marionette protocol. I was trying with Chrome to begin with, but the Devtools protocol forces you into using WebSockets which makes things really interesting when it comes to listening for events and acting on them
<FromGitter> <watzon> Much easier in node
<FromGitter> <meltheadorable> what does timeout refer to? like what type of timeout
<FromGitter> <watzon> For right now it's just an all encompassing timeout. It is used for attempting to connect to the browser instance, executing js scripts, etc
<FromGitter> <watzon> I'll be expanding it into multiple timeouts in the future
<FromGitter> <j8r> it works in Firefox and Chromium?
<FromGitter> <j8r> it seems to be only Chromium https://github.com/watzon/marionette
<FromGitter> <watzon> No just firefox for now
<FromGitter> <watzon> I don't have the most recent source uploaded to github
<FromGitter> <j8r> ok, that's confusing :/
<FromGitter> <watzon> @meltheadorable just added support for this ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d41f8f851d80b6c650cce7e]
<FromGitter> <j8r> what do you think of https://wiki.qt.io/QtWebEngine ?
<FromGitter> <watzon> Sounds really similar to WebDriver to me
<FromGitter> <j8r> I wonder if we can link the engine into our program, to have a browser in Crystal :)
<FromGitter> <j8r> oh yes, it uses Blink
<FromGitter> <watzon> There's also https://github.com/zserge/webview
<FromGitter> <watzon> I have a plan to write an Electron type framework around it
<FromGitter> <watzon> Lighter weight than electron though
<FromGitter> <absolutejam_gitlab> I feel we need some blessed shards
<rkeene> I plan to do something similar with Tcl/Tk and Duktape
<FromGitter> <j8r> @watzon you are not alone on this
<FromGitter> <absolutejam_gitlab> Like 'requests' in Python. Wlel documented, almost the go-to for shards
<FromGitter> <absolutejam_gitlab> So many shards with no docs or just an example
<FromGitter> <absolutejam_gitlab> Well documented *
<rkeene> absolutejam_gitlab, What would be great is a system that compared man pages to public interfaces and rated them
<FromGitter> <j8r> I recommend https://github.com/crystal-community/cossack
<FromGitter> <j8r> cc @absolutejam_gitlab
<FromGitter> <meltheadorable> is there a rough crystal equivalent to rack yet? i feel like if that doesn’t establish itself pretty early you’ll end up with python’s situation where multiple frameworks can’t all benefit from that common base
<FromGitter> <meltheadorable> python’s competing http stacks are a real issue
<FromGitter> <absolutejam_gitlab> Thanks @j8r but it's not that specific shard I mean
<FromGitter> <absolutejam_gitlab> I just mean that there's a growing quantity of shards, but they don't have the quality
<FromGitter> <absolutejam_gitlab> and when you search for them, it's 'which one do I use that has 1/3 of the features/docs I need'
<FromGitter> <absolutejam_gitlab> I don't mean this to sound ranty, it's just a case that the ecosystem is still young and there's not the solid de-facto shards. Maybe I should just go contribute docs, examples, etc. to some and see if it helps the popularity
<FromGitter> <absolutejam_gitlab> dunno
<FromGitter> <absolutejam_gitlab> Like golang has cobra for CLIs, python has click. There are others, but these are the go-to in their category
<FromGitter> <absolutejam_gitlab> Still playing with code generation @meltheadorable. Fun little task this.
<FromGitter> <meltheadorable> glad it’s fun ^_^
<FromGitter> <meltheadorable> i think go-to shards emerge because they hit a really needed niche at the right time
<FromGitter> <meltheadorable> or rather go-to libraries in general
<FromGitter> <meltheadorable> quality helps, but like a lot of stuff right now is either experimental or operating in a weird niche that not that many need something to fill
<FromGitter> <absolutejam_gitlab> yeah, I agree
<FromGitter> <absolutejam_gitlab> I just wish people would write docs for their shards!
<FromGitter> <meltheadorable> i haven’t published any of my crystal code yet because i have no idea wtf im doing
<FromGitter> <absolutejam_gitlab> me too. I have a lib I've been using but i want to de-uglify some of the dirtier bits
<FromGitter> <watzon> @absolutejam_gitlab same
<FromGitter> <watzon> People need to document
<FromGitter> <absolutejam_gitlab> Even if people just did the basic comments & a few examples and relied on `crystal docs`
<FromGitter> <tenebrousedge> tests are one of the more reliable forms of documentation. But people don't write those either D:
<FromGitter> <meltheadorable> i do
<FromGitter> <absolutejam_gitlab> for a consumable lib, documentation means people have an entrypoint to using it
<FromGitter> <absolutejam_gitlab> spec tests can be a bit abstract if you're foreign to the lib
<FromGitter> <absolutejam_gitlab> should I say abstract?
<FromGitter> <absolutejam_gitlab> is that allowed?
<FromGitter> <meltheadorable> lmao
<FromGitter> <Blacksmoke16> docs are the most impt thing in a lib
<FromGitter> <kniknoo> I love the language of it though, it inspires me to write better object and method names.
<FromGitter> <Blacksmoke16> otherwise no one would know how to use it, and thus no one would use it
<FromGitter> <meltheadorable> docs are the second most important thing in a lib
<FromGitter> <Blacksmoke16> what? behind it actually doing what is documented? :P
<FromGitter> <meltheadorable> the first most important thing is the lib, otherwise there would be no lib and nobody can use it
sorcus has quit [Ping timeout: 250 seconds]
<FromGitter> <meltheadorable> though yes documentation is only useful if accurate
<FromGitter> <Blacksmoke16> crystal docs helps a lot with that
<FromGitter> <meltheadorable> perhaps
<FromGitter> <Blacksmoke16> is easier to get at least something going
<FromGitter> <watzon> 😂 abstract
<FromGitter> <watzon> It's my new favorite word
<FromGitter> <Blacksmoke16> then usually have some `.md` files that do more explanation/in depth detail
<Stephie> they're different usecases really
<Stephie> API docs vs guides on structure, and common usages
<FromGitter> <Blacksmoke16> depending on the lib they can be similar
<Stephie> although you can sometimes fit that in the class-level documentation
<FromGitter> <meltheadorable> personally i intend to write both docs and specs for anything i make that is fit for human consumption
<FromGitter> <Blacksmoke16> is the way to go
<Stephie> yeah!
<FromGitter> <watzon> I try my best to document things thoroughly
<Stephie> i'd like to have `crystal docs` support other kinds of pages though, i guess
<FromGitter> <watzon> And where I can I try to make sure things are spec'd out right
<FromGitter> <watzon> `crystal docs` needs a lot of help
<FromGitter> <watzon> There are many things missing
<Stephie> it's pretty good
<Stephie> honestly
<Stephie> it's a good start :)
<Stephie> what stuff do you miss the most?
<FromGitter> <Blacksmoke16> it can also output json iirc
<FromGitter> <meltheadorable> inquiry — i don’t know that a best practice has emerged around this yet — should a shard that wraps a C library be ⏎ ⏎ 1) One shard, with a crystal-like interface provided over top of the bindings ⏎ 2) Two shards, one for the bindings and one that depends on the bindings to provide the crystal-like interface [https://gitter.im/crystal-lang/crystal?at=5d420015b336537fd4104f62]
<FromGitter> <bajro17> @meltheadorable are you say yesterday or few days before that you want make SNMP server?
<Stephie> @meltheadorable most do (1)
<FromGitter> <Blacksmoke16> id say 1
<Stephie> and I think for almost all C libs, 1 is what you want
<Stephie> in rare cases you'll want (2)
<FromGitter> <meltheadorable> is that the best idea or just the easiest for people experimenting?
<FromGitter> <Blacksmoke16> the 2nd would be most useful if its more than just providing bindings to the lib
ht_ has quit [Read error: Connection reset by peer]
<FromGitter> <Blacksmoke16> i.e. extra functionality while using the bound lib as a base
<FromGitter> <absolutejam_gitlab> opinions: ⏎ ⏎ ```"#{foo}.cr"``` [https://gitter.im/crystal-lang/crystal?at=5d4200535367476cc9890f21]
<Stephie> what's easy to maintain *is* the best idea
<FromGitter> <absolutejam_gitlab> I'd always do the latter because I like the look of interpolation
<FromGitter> <Blacksmoke16> yes, it also auto handles casting to string
<FromGitter> <tenebrousedge> I prefer interpolation mostly
<FromGitter> <absolutejam_gitlab> Even if the interpolation adds more key presses in that scenario
<FromGitter> <bajro17> https://github.com/spider-gazelle/crystal-snmp because I find this
<FromGitter> <Blacksmoke16> main benefit is if `foo` is not a string
<FromGitter> <Blacksmoke16> interpolation does `.to_s` under the hood
<FromGitter> <absolutejam_gitlab> true dat
<FromGitter> <tenebrousedge> I don't usually conserve keypresses, and when I do, the code usually suffers in legibility
<FromGitter> <Blacksmoke16> concat is a bit faster in some cases tho
<FromGitter> <meltheadorable> I think the line between extra functionality and just a binding gets pretty fuzzy when you’re like, making wrapping functions that take blocks and abstracting away interactions with pointers
<FromGitter> <watzon> Steffie the main thing that I'm missing is custom templates, but there are a lot of things that YARD has that would be useful. Groups, the ability to define custom metadata, `@see`, `@note`, `@param`, etc.
<FromGitter> <meltheadorable> and i could see a reasonable person wanting to not have to rebind the library to make different decisions about the best way to expose the functionality in a more native crystal style
<Stephie> I think, that for most bindings, there simply isn't enough room for two different high-level APIs
<Stephie> most of the high-level APIs aren't *that* much extra code
<Stephie> at the end of the day, you can easily copy-paste the actual C bindings if you're making a different lib
<Stephie> they're usually not hard to maintain
<Stephie> and if they are
<Stephie> it's easy to co-ordinate with another shard author
<Stephie> to split the bindings into a shard
<FromGitter> <meltheadorable> I guess that’s fair, it just feels a little weird to me, they feel like almost entirely distinct codebases
<Stephie> if it's necessary
<FromGitter> <meltheadorable> I like some of the mental separation that comes with that
<Stephie> I prefer fewer, larger shards where possible
<FromGitter> <watzon> @j8r marionette (https://github.com/watzon/marionette) has been updated, should be less confusing now
<Stephie> npm has the wrong philosophy, to me
<FromGitter> <watzon> Docs are coming soon
<Stephie> that is kind of a different discussion
<Stephie> but I don't think splitting up shards "just because" is a good reason
<FromGitter> <watzon> I think most people would agree that NPM sucks
<Stephie> there should be a concrete reason why you'd need just the bindings
<Stephie> and not the HL wrapper
<Stephie> if you go that direction
<FromGitter> <meltheadorable> i mean i am 100% not advocating for microlibraries, nobody should be packaging a shard that checks to see if there’s a file there
<Stephie> not just, for cleanliness
<Stephie> since files/folders can provide just the same
<Stephie> also, crystal already provides a clean interface between low-level bindings and HL bindings:
<Stephie> `lib` scopy
<Stephie> scope*
<FromGitter> <watzon> I think it really comes down to "will having these pieces as separate shards make things easier, or harder?"
<FromGitter> <watzon> If it's going to make things harder for developers I wouldn't do it
<Stephie> and it seems almost always harder, personally
<FromGitter> <watzon> But if there's no real change or it makes things easier/more clear, I'd do it
<FromGitter> <meltheadorable> i think most high level wrappers don’t expose all the functionality of the lower level bindings, i am just wondering if having a just-the-bindings lib that high level wrapper authors could work from might help people along with making one more complete
<FromGitter> <meltheadorable> just raising the baseline
<Stephie> I think PRs would be far more welcome in that situation
<FromGitter> <tenebrousedge> ^
<Stephie> if you want to test out additions, monkeypatching inside your project then turning that into a PR once it's proven is easy
<Stephie> crystal provides nice flexibility with that
<FromGitter> <meltheadorable> I guess I just haven’t realistically seen that kind of convergence happening, was wondering if a split approach might have more legs
<FromGitter> <meltheadorable> & make people less likely to abandon the work
dingenskirchen has quit [Remote host closed the connection]
dingenskirchen has joined #crystal-lang
<Stephie> i'm not sure that'd work out in practice, it's a cost/benefit, most of the costs being maintainance friction, and most of the benefits being theoretical, in the future, and to other people
<FromGitter> <meltheadorable> i guess im not seeing the maintenance friction part
<Stephie> two repos means any changes to the bindings mean having to cut a shards release, push the tag, update shard.yml in the other repo, etc
<Stephie> it's really... not great
<Stephie> monorepo workflow seems to end up better in practice, from what i;ve read
<Stephie> and this seems the same situation but smaller
<FromGitter> <watzon> monorepos can get way too big and unwieldy though
<FromGitter> <watzon> I was part of a team that had one repo for a large project
<FromGitter> <meltheadorable> only if the changes to the bindings are breaking, which seems like would be a versioning issue with the upstream library, and worth versioning separately from the high-level wrapper
<FromGitter> <watzon> It was a nightmare
<FromGitter> <meltheadorable> like that’s what i mean — these are functionally separate codebases, with a dependency on an outside library that is also versioned, i feel like keeping the raw bindings separate is cleaner if the translation to the higher level wrapper isn’t straightforward & you want to have some versioning transparency
<rkeene> watzon, My monorepo project worked out pretty well -- for a Linux distribution that had many related ways to build (virtual appliances)
<Stephie> @meltheadorable no, if you add features to the bindings you need to do all that for the wrapper
<FromGitter> <meltheadorable> you already need to do them separately
<FromGitter> <meltheadorable> idk, i’m not seeing the friction here
<FromGitter> <dscottboggs_gitlab> evening fellow Crystal programmers!
* FromGitter * dscottboggs_gitlab isn't writing JavaScript
* FromGitter * dscottboggs_gitlab wouldn't do that, would he?
<rkeene> There are Crystal bindings for Duktape -- they even worked okay
<FromGitter> <tenebrousedge> JS is an occupational hazard for most of us
<FromGitter> <dscottboggs_gitlab> truth haha
<FromGitter> <dscottboggs_gitlab> TBH it's not the JS i have a hard time with, it's the CSS
<FromGitter> <dscottboggs_gitlab> ugh, why is it up there!?
<FromGitter> <dscottboggs_gitlab> 🤣 😆
<FromGitter> <dscottboggs_gitlab> I'm dying fuck that's so funny
<FromGitter> <dscottboggs_gitlab> Also, thank you for the properly-scrubbed-of-tracking-data-Amazon-link @rkeene
alex`` has quit [Ping timeout: 272 seconds]
<FromGitter> <Blacksmoke16> you at least using TS @dscottboggs_gitlab ? :P
<FromGitter> <dscottboggs_gitlab> I tried
<FromGitter> <Blacksmoke16> uh oh, that doesnt sound promising
<FromGitter> <dscottboggs_gitlab> I had too many problems that just slowed me down like crazy. A weeks worth of struggling with TS got rewritten in JS in maybe 2 hours.
<FromGitter> <Blacksmoke16> :(
<FromGitter> <Blacksmoke16> TS is better in the long run, JS beats it by far for just throwing stuff together
<FromGitter> <Blacksmoke16> making some client app?
<FromGitter> <tenebrousedge> TS is a deep rabbit hole layered on top of a language that's more inconsistent than PHP
<FromGitter> <dscottboggs_gitlab> Yeah, laying the foundations for the WebUI for DPPM (https://github.com/DFabric/dppm)
<FromGitter> <Blacksmoke16> using a framework or?
<FromGitter> <dscottboggs_gitlab> TBH I had an idea earlier that I feel would give me an advantage over even typescript, while still being in JS... The system is in react, so what if I use redux and build the whole app on stateless functional commponents, with specified PropTypes?
<FromGitter> <Blacksmoke16> :shrug:
<FromGitter> <tenebrousedge> React Stateless Functional Component with TypeScript (https://medium.com/@ethan_ikt/react-stateless-functional-component-with-typescript-ce5043466011)
<FromGitter> <tenebrousedge> React Hooks in Typescript (https://medium.com/@jrwebdev/react-hooks-in-typescript-88fce7001d0d)
<FromGitter> <watzon> Idk about being more inconsistent than PHP
<FromGitter> <dscottboggs_gitlab> yes, I was using those in TS. but to use them exclusively in JS would give you type guarantees at the interface level, and give you a centralized place to manage state, without having to encumber your codebase with the intricacies of TypeScript
<FromGitter> <tenebrousedge> PHP is inconsistent in parameter order and boolean comparisons. JS has a lot of very weird behaviors
<FromGitter> <dscottboggs_gitlab> > PHP is inconsistent in parameter order ⏎ ⏎ Idk php what do you mean?
<FromGitter> <watzon> That's just JS in general though. Typescript at least tries to mitigate some of those weird behaviors.
<FromGitter> <watzon> It's also a lot nicer to develop with imo
<FromGitter> <tenebrousedge> PHP flaws (http://phpsadness.com/)
<FromGitter> <dscottboggs_gitlab> Oh, I see, I thought you meant something more fundamental
<FromGitter> <tenebrousedge> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d4221665367476cc989ec9d]
<FromGitter> <tenebrousedge> JS has a weird object model, which is papered over with the `class` syntax, and confusing scope
<FromGitter> <tenebrousedge> PHP is clunky and inconsistent, but it's a pretty boring C-derivative
<FromGitter> <dscottboggs_gitlab> yeah I agree about JS but I'm familiar enough with those idiosyncracies that they don't bother me so much
<FromGitter> <tenebrousedge> JS has generally better functional abstractions
<FromGitter> <dscottboggs_gitlab> although having to manually `.bind()` methods is annying and a common source of bugs both in TS and JS
dingenskirchen has quit [Ping timeout: 264 seconds]
lucasb has quit [Quit: Connection closed for inactivity]