« Back to channel list

#ruby-offtopic - 02 January 2018

« Back 1 day Forward 1 day »
[08:16:37] pwnd_nsfw`: has joined #ruby-offtopic
[09:04:50] mikecmpbll: has joined #ruby-offtopic
[12:50:21] tcopeland: has joined #ruby-offtopic
[14:22:39] apeiros: yay, first steps in rust! on to new shores!
[14:22:49] apeiros: finally got an excuse to write my own database :o)
[14:56:55] apeiros: $deitiy damit, I have to fix my bash prompt for git repos without any commits (fresh repos)
[15:03:01] dminuoso: apeiros: Rust is pretty slick, even though it lacks higher kinded types. :(
[15:03:14] dminuoso: Private project or company?
[15:05:29] apeiros: private project
[15:05:34] apeiros: company is still 100% ruby :D
[15:06:02] apeiros: higher kinded types: that's what's cargo there for, no?
[15:06:06] apeiros: as in: get a library?
[15:06:19] dminuoso: no, it's for abstracting over polymorphic types
[15:07:19] dminuoso: It's a very simple idea that gives you a lot of expressivity in the type system.
[15:08:18] dminuoso: apeiros: Have you worked with traits already?
[15:08:47] dminuoso: You're in for a treat then. :)
[15:09:15] dminuoso: Elixir protocols ring a bell perhaps?
[15:09:26] dminuoso: Or concepts in C++?
[15:09:44] apeiros: I have an idea what treats are
[15:10:03] apeiros: I haven't worked with them, though. mainly because other than ruby, js, C and C++ I didn't use any language
[15:10:09] apeiros: oh, and plsql *shudders*
[15:10:25] apeiros: (that's a treat, lol)
[15:10:27] dminuoso: apeiros: Oh C++ should give you an idea what they are about.
[15:10:33] dminuoso: Let me give you a simple example
[15:11:54] dminuoso: apeiros: https://gist.github.com/dminuoso/43bb5745ee8622980ddc47ce7f3c2eb6
[15:12:11] dminuoso: apeiros: So depending on your compiler and the version, this can easily give you up to 300 lines of error messages.
[15:15:54] apeiros: I assume the trait is related to sort being able to sort a varying set of types, in this case, a list?
[15:16:34] dminuoso: apeiros: Well the issue is list is not a random access container (because its a doubly linked list) right?
[15:17:05] dminuoso: C++ template system has no sensible way of expressing whether a given type satisfies an interface by implementing certain methods.
[15:17:22] dminuoso: So things just crash during template substistution
[15:18:10] dminuoso: Instead of saying "no instance RandomAccessIterator for ..."
[15:18:47] dminuoso: In a way traits let you express an interface like Enumerable by requiring any type that claims to fulfill the interface to actually implement it.
[15:19:17] dminuoso: With higher kinded types you can do this trick with an additional degree of freedom
[15:20:50] dminuoso: C++ has higher kinded types though due to a not-well known part of the template system where you go: template <template <typename> class M> ...
[15:30:58] apeiros: uh, rust lets you change the type of a variable :-S
[15:31:22] mikecmpbll: has joined #ruby-offtopic
[15:32:19] leah2: just shadowing no?
[15:32:30] apeiros: even worse then?
[15:32:45] apeiros: multiple variables with the same name?
[15:33:12] leah2: works in most functional languages fine?
[15:35:22] apeiros: I'm not used to functional languages. well, I'll see how it plays out. but it strikes me as a rather bad/confusing idea. probably the less experienced a coder is, the more confusing.
[15:35:37] leah2: perhaps its confusing for mut variables
[15:35:48] leah2: but else you have single-assignment anyway
[15:38:14] leah2: in C, you need additional {} to allow it :)
[15:38:42] dminuoso: apeiros: Probably yeah. At any rate, traits are a type safe way to do things like Enumerable or Comparable in Ruby. :)
[15:41:18] dminuoso: i.e. type safe adhoc polymorphism
[15:57:41] mikecmpb_: has joined #ruby-offtopic
[16:29:23] kapil___: has joined #ruby-offtopic
[17:16:30] havenwood: dminuoso: chruby users don't seem to have PATH-related problems, but I think they're just more likely to know their way around a terminal, know what env vars are, etc.
[17:16:47] havenwood: It's really easy to be a chruby maintainer. ;-)
[17:17:01] havenwood: Users know what they're doing and a hundred lines of code to support.
[17:17:19] havenwood: A lot of the RVM issues seem to be just folk being completely lost.
[17:17:26] havenwood: And then the tens of thousands of lines of shell, of course.
[17:17:31] dminuoso: havenwood: It's silly even to just look into chruby and see how it works. Took me just under 3 minutes.
[17:17:51] dminuoso: havenwood: Indeed, and tons of commands that do magical things.
[17:18:03] havenwood: mrvm is hte one that cracked me up
[17:18:10] havenwood: chruby support within RVM
[17:18:19] havenwood: And I didn't even write it! Hah
[17:29:51] havenwood: dminuoso: https://rvm.io/workflow/chruby
[17:30:11] havenwood: It's a mini-game inside RVM ¯\_(ツ)_/¯
[17:30:39] dminuoso: Oh it's like Maniac Mansion inside Day of the Tentacle!
[17:30:45] havenwood: dminuoso: https://github.com/rvm/rvm/blob/master/scripts/extras/chruby.shhttps://github.com/rvm/rvm/blob/master/scripts/extras/chruby.sh
[17:30:45] dminuoso: Goodie, I loved that.
[17:30:47] havenwood: dminuoso: Exactly!
[17:33:06] dminuoso: havenwood: Whats the deal with jdgkjnfnkjdngjkfnd4fd?
[17:33:41] havenwood: oops, double-pasted: https://github.com/rvm/rvm/blob/master/scripts/extras/chruby.sh
[17:33:53] dminuoso: Yeah noticed and fixed it :)
[17:41:52] eckhardt: has joined #ruby-offtopic
[17:49:58] nofxx: has joined #ruby-offtopic
[17:57:13] workmad3: has joined #ruby-offtopic
[19:15:17] mikecmpbll: has joined #ruby-offtopic
[19:17:01] apeiros: from the top of my head it seems rust and swift take the same (or very similar) approach to null/nil types
[19:28:00] mikecmpb_: has joined #ruby-offtopic
[19:31:07] dminuoso: apeiros: Yeah. Typetheorywise it's just a sum/coproduct type if you've heard of that.
[19:31:30] dminuoso: And its fairly commonly in statically typed languages.
[19:31:48] dminuoso: C++ has it too nowadays with std::optional :)
[19:32:18] dminuoso: It's neat in that the type system forces you to acknowledge and deal with the possibility of null.
[19:33:23] mikecmpbll: has joined #ruby-offtopic
[20:09:38] helpa: has joined #ruby-offtopic
[21:07:47] mikecmpb_: has joined #ruby-offtopic
[21:16:49] nofxx1: has joined #ruby-offtopic
[22:02:04] tcopeland: has joined #ruby-offtopic
[22:56:10] mikecmpbll: has joined #ruby-offtopic