<FromGitter>
<Blacksmoke16> dont think that would work?
<FromGitter>
<tenebrousedge> I suspect you're right
<FromGitter>
<Blacksmoke16> because im wrapping IOs in a class vs using them directly
<confact>
Is it any way to generate a self-signed SSL certificate in crystal's stdlib? Can't find that.
<FromGitter>
<tenebrousedge> and the class doesn't expose the IOs via delegation?
<FromGitter>
<Blacksmoke16> naw, its private to the handler
<FromGitter>
<Blacksmoke16> confact im not sure, if anything it would be in the `OpenSSL` module
<FromGitter>
<ImAHopelessDev_gitlab> @ilanpillemer what is the editor you use called again? i had some memory issues last night, vscode was hovering around 500mb of ram when i had 10 cr files open. was just too much. ⏎ i raged, and then just started to code in notepad. felt kinda cool, but missed the format on save
<FromGitter>
<Blacksmoke16> yea might go with a module that ill include in the processing handler (that allows for formatters), that will default to false, but allow children to override it
<FromGitter>
<Blacksmoke16> `@io.tty?` would prob be better
<FromGitter>
<tenebrousedge> probably
<FromGitter>
<Blacksmoke16> i could go with that, if a user wants they can also reopen and define their own logic
<FromGitter>
<ImAHopelessDev_gitlab> @tenebrousedge oh yeah, ACME. thanks gonna give it a try now.
<FromGitter>
<watzon> Lol 500MB really isn't that bad for something that's almost an IDE
<FromGitter>
<tenebrousedge> if you only have 500MB it might be a lot
<FromGitter>
<Blacksmoke16> who only has 500mb of ram
<FromGitter>
<watzon> If you only have 500MB you've got bigger issues
<FromGitter>
<Blacksmoke16> what they doing on, an RPI1?
<FromGitter>
<Blacksmoke16> coding*
<FromGitter>
<Blacksmoke16> `String#delete` should have an overload for `Regex`
<FromGitter>
<tenebrousedge> I'm sure I don't know. But I'd still go with spacevim. I need syntax highlighting
<FromGitter>
<watzon> Right now I have Code and PyCharm open. Code is hovering around 330MB and PyCharm is using about 1.1GB
<FromGitter>
<watzon> SpaceVim is nice
<FromGitter>
<tenebrousedge> @Blacksmoke16 it does patterns. `gsub(//, '')` should do for the rest
<FromGitter>
<tenebrousedge> not that I necessarily disagree, mind
<FromGitter>
<ImAHopelessDev_gitlab> I really miss Notepad++. I used that editor for years when I was younger
<FromGitter>
<tenebrousedge> bluefish is pretty similar
<FromGitter>
<ImAHopelessDev_gitlab> Never heard of bluefish, I'll google it
<FromGitter>
<ImAHopelessDev_gitlab> Wow, it is, nice
<FromGitter>
<tenebrousedge> let me know how similar you find it; I used it for a while, but by the time I started coding I was off Windows, so I have no direct comparisons myself
<FromGitter>
<ImAHopelessDev_gitlab> @tenebrousedge I'm back to vscode. I don't think i'll be able to change atm, vscode is instilled in my mind pretty hard, it will be hard to let it go.
<FromGitter>
<tenebrousedge> what features do you miss?
<FromGitter>
<ImAHopelessDev_gitlab> Just the look and UI, it's all comfortable and stuff I'm used to
<FromGitter>
<sam0x17> same for me
<FromGitter>
<sam0x17> if I even change syntax highlighting themes it looks like a different language to me
<FromGitter>
<tenebrousedge> huh
<FromGitter>
<sam0x17> I actually use the atom one dark theme in vscode
<FromGitter>
<sam0x17> because I used atom forever
<FromGitter>
<sam0x17> I'm very fussy about how things look :P
<FromGitter>
<ImAHopelessDev_gitlab> @sam0x17 When I used notepad++ way back when I was a kid (14-15 to until 25 or so), I tried switching to a new editor and could never do it. I finally had to when I started to use Crystal though because of the format on save hahah.
<FromGitter>
<sam0x17> lolz
<FromGitter>
<ImAHopelessDev_gitlab> I tried so many editors... could never get away from Notepad++ ahhaha
<FromGitter>
<sam0x17> I've basically been Eclipse (java and C++) => Atom => vscode (over the course of 10 years)
<FromGitter>
<sam0x17> with nano randomly thrown in for things like git commits and when I'm starting a new project before I've opened it in an IDE
<FromGitter>
<tenebrousedge> I rather like nano. It does syntax highlighting, too, if you enable it
<FromGitter>
<sam0x17> after 12 years of coding I'm happy to say I now how to escape from VI/VIM if it opens
<FromGitter>
<sam0x17> *know
return0e_ has quit [Remote host closed the connection]
<FromGitter>
<sam0x17> xD
<FromGitter>
<sam0x17> yeah the syntax highlighting is nice
<FromGitter>
<tenebrousedge> I picked up vim this year. spacevim anyway
<FromGitter>
<sam0x17> I've always wanted to try making a vscode-style terminal IDE, with mouse support etc
<FromGitter>
<tenebrousedge> and switched to vim bindings in VSCode
<FromGitter>
<sam0x17> the killer feature for vscode over atom was the built in terminal pane
<FromGitter>
<sam0x17> vs in atom I had to use addons (that failed a lot) to do that
<FromGitter>
<tenebrousedge> you'd love spacevim then
<FromGitter>
<sam0x17> probably
<FromGitter>
<tenebrousedge> `SPC + '` opens the terminal
<FromGitter>
<tenebrousedge> and you have the full vim-powered copy and paste
<FromGitter>
<sam0x17> I just can't with the keyboard shortcuts but I did try to learn vim once
<FromGitter>
<tenebrousedge> there's a built-in tutorial, and spacevim is pretty good at reminding you what's what
<FromGitter>
<tenebrousedge> if you just hit `SPC` and wait a second it shows all possible commands, and you can then drill down through the menus
<FromGitter>
<sam0x17> vscode drives me nuts with its autocompletions
<FromGitter>
<sam0x17> tbh
<FromGitter>
<sam0x17> that and it sucks at properly indenting copy pasted code
<FromGitter>
<sam0x17> does everything else right though
<FromGitter>
<sam0x17> atom was better at formatting arbitrary languages
<FromGitter>
<tenebrousedge> vscode has good test runners
<FromGitter>
<tenebrousedge> maybe even great test runners
<FromGitter>
<sam0x17> I haven't used that but I can imagine -- the tooling for java and C++ is very good
<FromGitter>
<tenebrousedge> and completion for javascript is waaaaaay better
<FromGitter>
<sam0x17> yes
<FromGitter>
<sam0x17> though the only thing I ever need js completion for is to remember if its `.startsWith` or `.startWith`
<FromGitter>
<watzon> Trump voice: *VS Code has great test runners. They are probably the best test runners I've ever seen. They wouldn't have such tremendous test runners if it wasn't for me.*
<FromGitter>
<tenebrousedge> with React I need all the help I can get
* FromGitter
* sam0x17 skitters back into his cave *eek react*
<FromGitter>
<watzon> That's because react sucks
<FromGitter>
<watzon> *Runs*
<FromGitter>
<sam0x17> the 3 times I've almost had to react I made my own half-baked js framework instead
<FromGitter>
<sam0x17> *to use react
<FromGitter>
<sam0x17> been thinking of using svelte though
<FromGitter>
<sam0x17> or vue, but svelte looks really interesting
<FromGitter>
<sam0x17> I just want to avoid npm
<FromGitter>
<sam0x17> tho
<FromGitter>
<watzon> That's because React is a *build your own framework* kit. It's not a framework itself, just a library.
<FromGitter>
<tenebrousedge> I don't really care about react *per se*, but redux is fairly important to me
<FromGitter>
<watzon> Svelte is nice, but I don't feel like it's super ready yet. I love Vue though.
<FromGitter>
<tenebrousedge> the last time someone told me to work without redux I simply reimplemented it from scratch
<FromGitter>
<sam0x17> I have only gone deep enough to know that redux is the "state management" stuff
<FromGitter>
<sam0x17> and its funny because I managed a team that was doing a react app
<FromGitter>
<tenebrousedge> it's "state only changes in specific ways" stuff
<FromGitter>
<tenebrousedge> which is the useful bit
<FromGitter>
<sam0x17> I've just never understood the itch all that stuff is trying to scratch
<FromGitter>
<tenebrousedge> was your JS dealing with a remote API?
<FromGitter>
<sam0x17> yes, always
<FromGitter>
<tenebrousedge> implementing more than one API call is pretty much where I want state handling
<FromGitter>
<sam0x17> I just usually have a client-side `api.js` file with centralized "request" method that includes re-logging in, session management, error handling logic, and then have a bunch of methods that use that method to define different endpoints
<FromGitter>
<sam0x17> and then the ensuing callback hell xD
<FromGitter>
<Blacksmoke16> would loose the desc tho
<FromGitter>
<sam0x17> that or things with polymorphism where I'm writing Foo, and someone in another shard is going to use Foo in their Bar, and a method of Foo might call a method of Bar that in turn throws an exception only Bar knows about
<FromGitter>
<sam0x17> so aka which exceptions show up might change depending on third party code
<FromGitter>
<sam0x17> but generally yeah I think we could do it statically
<FromGitter>
<sam0x17> no idea if crystal provides enough introspection to do it, but I did some similar static analysis of C++ code a few years ago and yeah you could def do this at compile time
<FromGitter>
<Blacksmoke16> dunno, the `RAISES: ` syntax would prob be much easier to implement
<FromGitter>
<sam0x17> ah, here is your contrived example @tenebrousedge: ⏎ `raise error_array[File.read("path").to_i]`
<FromGitter>
<tenebrousedge> what even is that?
<FromGitter>
<sam0x17> you have an array of different error types, and you raise one based on a number saved in a file that is an index into the array
<FromGitter>
<tenebrousedge> make it stop :(
<FromGitter>
<sam0x17> or something like `raise [err1, err2, err3].sample`
<FromGitter>
<ilanpillemer> @ImAHopelessDev_gitlab it is a completely different paradigm to menu driven (eg vscode) and also char driven (eg emacs, vi). It also expects an understanding of *ix as a programming environment,
<FromGitter>
<ilanpillemer> There is a very sharp learning curve
<FromGitter>
<ilanpillemer> it is *very* niche.
<FromGitter>
<ilanpillemer> there is however a dedicated long standing community around it
<FromGitter>
<sam0x17> @ilanpillemer you can always use `self.` to disambiguate, as people do in java
<FromGitter>
<sam0x17> on the topic of js frameworks, I wrote this for work and intend to clean it up and make it actually nice at some point: https://github.com/sam0x17/conduit
<FromGitter>
<sam0x17> designed for deploying to S3 / cloudfront --- you set up `/*` to redirect to `/router.html` on the cloudfront side, and then javascripts handles all the routing from there. All views are pre-compiled to a compressed hash in the `router.html`, and body contents get swapped out (similar to rails's turbolinks) whenever a link to a routing path is pressed, so you effectively get instant page loads. Then you hook it
<FromGitter>
... up to a lambda-based API server, and you're 100% serverless with instant page loads
<FromGitter>
<sam0x17> works great if you have under 200 unique view templates, over that it's better to split it into multiple routers
<FromGitter>
<sam0x17> I need to invent a component paradigm for it as well -- my usage has just been basic jquery-ish API stuff, directly changing dom elements and contents
<FromGitter>
<sam0x17> it's also designed with a hatred and avoidance of NPM xD
<FromGitter>
<ilanpillemer> yes. in many ways I find it sucks.. but yet I do believe its the most secure package system I have ever used.. and hence the best.
<FromGitter>
<ilanpillemer> so what I guess I am asking is what do you think of it in terms of the secureness and dependability and trustworthiness.
<FromGitter>
<absolutejam_gitlab> Oh, I see. Yeah, most package systems are pretty ropey to be honest
<FromGitter>
<ilanpillemer> for example.. so guy can just delete a dependency or change it.
<FromGitter>
<absolutejam_gitlab> Github being a source of truth and no guarantees of MFA, authenticity, etc.
<FromGitter>
<ilanpillemer> yes, the famous left trim from npm for example
<FromGitter>
<absolutejam_gitlab> But I've published something on PyPi just for ease of use - not really for public consumption - and it's suddenly a thing
<FromGitter>
<absolutejam_gitlab> I prefer systems that refer to packages as `<owner>/<package>` than jus `<package>`
<FromGitter>
<ilanpillemer> what did you publish?
<FromGitter>
<absolutejam_gitlab> It was just to test creating a PyPi package
<FromGitter>
<ilanpillemer> and now its depended on by others?
<FromGitter>
<absolutejam_gitlab> Was it Steam that released a deb that did essentially did a `rm -rf `because of a bad variable?
<FromGitter>
<absolutejam_gitlab> some big package did it
<FromGitter>
<absolutejam_gitlab> or a browser perhaps
<FromGitter>
<absolutejam_gitlab> and that was in the debian repos iirc
<FromGitter>
<ilanpillemer> there was also one that just snuck in bitcoin mining
<FromGitter>
<absolutejam_gitlab> yeah, snap, npm, and other package managers have had that
<FromGitter>
<absolutejam_gitlab> > and now its depended on by others? ⏎ ⏎ No, thankfully not, but it was super easy I mean
<FromGitter>
<absolutejam_gitlab> and i didn't have to verify any kind of authenticity
<FromGitter>
<absolutejam_gitlab> and I used the word 'azure' in it
<FromGitter>
<ilanpillemer> so.. is there Crystal package manager.
<FromGitter>
<absolutejam_gitlab> So somebody could have
<FromGitter>
<absolutejam_gitlab> `shards` is the crystal package manager
<FromGitter>
<ilanpillemer> and how does it make it things trust worthy?
<FromGitter>
<ilanpillemer> Ive become paranoid lately, so I only depend on things that are significant, others I reinvent the wheel.
<FromGitter>
<absolutejam_gitlab> > the way Crystal shadows parameters with local variables of the same name I find frustrating ⏎ ⏎ What do you mean by this btw?
<FromGitter>
<absolutejam_gitlab> It doesn't afaik
<FromGitter>
<ilanpillemer> eg
<FromGitter>
<absolutejam_gitlab> It's another 'pull from Git' package manager
<FromGitter>
<absolutejam_gitlab> The best thing you can do is pin at a version and fork
<FromGitter>
<absolutejam_gitlab> then you're responsible for it
<FromGitter>
<absolutejam_gitlab> it's what I do at work for dependencies
<FromGitter>
<absolutejam_gitlab> instead of vendoring
<FromGitter>
<absolutejam_gitlab> Because I'm thinking about the variable type that comes in to the function - a String/Integer (etc.) doesn't get mutated whereas an Array or a class object will
<FromGitter>
<ilanpillemer> now items is a reference
<FromGitter>
<ilanpillemer> but the items you pass in wont get appended to
<FromGitter>
<ilanpillemer> as the one on the left is a new items
<FromGitter>
<ilanpillemer> a local variable that shadows the argument
<FromGitter>
<ilanpillemer> I keep getting caught out by different cases
<FromGitter>
<absolutejam_gitlab> I'm still not understanding
<FromGitter>
<ilanpillemer> in your version you also mutated the incoming one
<FromGitter>
<watzon> @absolutejam_gitlab you're trying to append and return a new array rather than appending to the referenced array?
<FromGitter>
<absolutejam_gitlab> oh, I assumed because of the same name...
<FromGitter>
<ilanpillemer> yes.
<FromGitter>
<absolutejam_gitlab> so, in your example why wouldn't you have `new_items = items + item`?
<FromGitter>
<ilanpillemer> I believe `ameba` reports these
<FromGitter>
<absolutejam_gitlab> or am I still confused haha
<FromGitter>
<ilanpillemer> its just simpe example
<FromGitter>
<absolutejam_gitlab> Sunday night is not a time for my brain to work, and I'm just not understanding the issue, sorry haha.
<FromGitter>
<watzon> It has to be `items = items + [item]` though
<FromGitter>
<absolutejam_gitlab> Yeah ^
<FromGitter>
<ilanpillemer> right
<FromGitter>
<watzon> The `+` is a concatenation operator, not appending
<FromGitter>
<absolutejam_gitlab> You need to add another array with that syntax right
<FromGitter>
<absolutejam_gitlab> Plus I have a very narrow view of languages, so what I expect is what the few languages I've dealt with have shown me
<FromGitter>
<ilanpillemer> so the `why` is not important
<FromGitter>
<absolutejam_gitlab> In Golang and languages of that kin where you explicitly pass by value or ref vs. the Pythons and Rubys of the world where you have to know if the input variable is mutable or not
<FromGitter>
<tenebrousedge> Ruby does do the same thing, essentially. It's technically pass-by-reference, but shadowing is allowed
<FromGitter>
<ilanpillemer> Go is bit tricky as slices are different to arrays
<oprypin>
ilanpillemer, one sugesstion - it's arguable if it's an improvement, because it's slightly harder to follow, but it's more efficient and less repetition. make `decom` accept a `ss : StringScanner` and `num_letters`. then you dont create any new stringscanners and eliminate the redundant advancing the old one as well
<oprypin>
then `def decom(s : String): decom(StringScanner.new(s), s.size)`
<oprypin>
actually maybe the *current* one is harder to follow because it made me ask the question :D
<FromGitter>
<ilanpillemer> hmm
<FromGitter>
<ilanpillemer> if its more efficient and less repetitive its an improvement
<FromGitter>
<ilanpillemer> does `+=` mutate?
<FromGitter>
<ilanpillemer> or does it shadow?
<FromGitter>
<tenebrousedge> mutate
<FromGitter>
<ilanpillemer> why do you have to have a space before the `:` for types?
<FromGitter>
<ilanpillemer> is that because `:` is a valid char in a variable name?
<FromGitter>
<ilanpillemer> I keep forgetting the space.
<FromGitter>
<ilanpillemer> The formatter then reminds me
<FromGitter>
<didactic-drunk> What chance is there of getting `ctime` and `birth_time` exposed in `File::Info` if I submit a PR? `st_ino` and `st_dev`?
<FromGitter>
<Blacksmoke16> id prob make an issue first, then go from there
mps has left #crystal-lang [#crystal-lang]
<FromGitter>
<ImAHopelessDev_gitlab> @ilanpillemer thanks for the info ⏎ @ilanpillemer what does "crystal shadows parameters with local variables of the same name" mean? Is there an example code of this and what are the side effects?
<FromGitter>
<tenebrousedge> inside the method, `a` is a new local variable. Since it has the same name as the outer variable, we say that it is "shadowing" the outer variable
<FromGitter>
<tenebrousedge> if instead you use `a += bar + [1]` then you are mutating the outer variable
<FromGitter>
<ImAHopelessDev_gitlab> I see, so it's important to have local variables not the same name as the parameter names?
<FromGitter>
<tenebrousedge> the `ameba` tool will tell you not to do that, correct
<FromGitter>
<tenebrousedge> it causes confusion and bugs
absolutejam2 has quit [Ping timeout: 268 seconds]
<FromGitter>
<ImAHopelessDev_gitlab> Wait really
<FromGitter>
<ImAHopelessDev_gitlab> "mutating the outer variable"
<FromGitter>
<ImAHopelessDev_gitlab> that doesn't sound good
<FromGitter>
<tenebrousedge> generally I would avoid trying to change variables that are not defined in the current scope
hightower3 has quit [Ping timeout: 240 seconds]
<Stephanie>
llvm 9 support seems to be about a +2 line diff