dminuoso

Activity Graph

Page 1 of 119 | Next »

2019-06-11

[07:21:55] dminuoso: ryez: Ruby is a big mess of syntax.
[07:22:05] dminuoso: ryez: Most of it is just iterative retrofitting features without much design. If you ask Matz & Co. they'll probably even tell you it's a feature.
[07:22:44] dminuoso: Nah being mad is no longer necessary. I don't write Ruby anymore.
[07:27:40] dminuoso: baweaver: None, honestly. :)
[07:27:40] dminuoso: baweaver: And honestly without a type system Im not interested in ADTs.
[07:27:40] dminuoso: baweaver: Nope.
[07:30:40] dminuoso: baweaver: Ive went deep enough into type theory and language design to understand why retrofitting a type system is a really bad idea in general.
[07:32:05] dminuoso: baweaver: In general you should start out with a type system, include all properties and feautres you want into it - and then carefully design the language around the type system.
[07:33:15] dminuoso: syndikate: In principle its the idea of being able to "add" and "multiply" types together.
[07:33:50] dminuoso: baweaver: I wish people would stop believing that.
[07:34:00] dminuoso: But we cant be able to get rid off that myth.
[07:34:07] dminuoso: *seem to be unable
[07:34:13] dminuoso: syndikate: Which stuff exactly?
[07:34:42] dminuoso: syndikate: Pierce's book Types and Programming Languages is probably the best book to read.
[07:34:48] dminuoso: (To get into)
[07:35:48] dminuoso: syndikate: To give you a quick idea of what ADTs are, it's the idea of being able to combine "union" and "struct" together in a nice fashion
[07:36:13] dminuoso: syndikate: So for example you might have the need to express `this thing is either an Int or a String`, or you might want to say "this thing has both an Int and a String"
[07:44:25] dminuoso: syndikate: The term Monoid captures the raw idea of "combining two things together into one" in a way that makes sense. Integer multiplication, integer addition, array concatenation, string concatenation, picking the lesser of two natural numbres..
[07:44:25] dminuoso: ACTION is not convinced that free monoids are the best way to introduce what a monoid is..
[07:45:23] dminuoso: syndikate: Anything more is just overwhelming and requires studying many examples in a setting where you can actually make use of what monoid captures
[07:46:19] dminuoso: syndikate: The monoid abstraction does not hold value in languages that dont employ polymorphism.
[07:46:27] dminuoso: syndikate: Its main use is deferring the choice of a monoid to someone else.
[07:46:43] dminuoso: syndikate: For example my API might say "Im gonna squish things together, but *you* decide using what monoid"
[07:47:05] dminuoso: syndikate: In Ruby you would generally encode this by returning a list (such that the consumer of your API can squish it together)
[07:48:05] dminuoso: syndikate: Its very general and not easy to spot unless you are in the habit of writing highly polymorphic code.
[07:48:52] dminuoso: And in languages that are very non-principled like Ruby it falls extremely short.
[07:50:24] dminuoso: syndikate: Its one way to think about it.
[07:59:11] dminuoso: syndikate: A motivating example might be the notion of a log.
[07:59:25] dminuoso: syndikate: Imagine you have some area of code that wants to "append to a log"
[08:00:06] dminuoso: So you'd start by thinking of a log as just string concatenation. You concatenate new entries onto the existing log.
[08:00:28] dminuoso: And if, for symmetry reasons, you were forced to emit log entries even if you didn't have anything to say you could still emit an empty string.
[08:00:45] dminuoso: Which is fine, because concatenating an empty string to some string A yields that same string A back.
[08:01:45] dminuoso: But perhaps we are not interested in a string log. Perhaps our log is just a "number of actions taken". So instead of emitting strings that get concatenating, you could emit numbers that get added.
[08:02:28] dminuoso: Now remember since we said, we might be forced to emit a log entry even if no action is taken. We could emit 0 in those cases, which is fine because adding 0 to a number does not change it.
[08:04:46] dminuoso: Or perhaps you have some software processing personal data, and the log is keeping track of the "oldest person" seen. If at some point you are not processing any person but were forced to produce a log entry, you could produce "0 years".
[08:09:02] dminuoso: syndikate: Now you might begin to see that in all cases you are somehow "combining/smashing" 2 into 1, and you always have a special element you can throw into the binary operation to produce a noop
[08:17:47] dminuoso: syndikate: Well the ergonomics become an important topic.
[08:18:33] dminuoso: syndikate: we could consider a module called Monoid, sort of like an interface, that you can include into a class.
[08:19:25] dminuoso: syndikate: One would be `def mappend(other); ... implement here; end` and the other would be `def mempty; ... implement here; end`
[08:19:44] dminuoso: Or rather `def self.mempty` in Ruby I guess.
[08:22:32] dminuoso: syndikate: well the method mappend captures that function.
[08:22:43] dminuoso: syndikate: Ruby just doesnt have any tools to write polymorphic code.
[08:52:43] dminuoso: has left #ruby: ("WeeChat 2.2")

2019-06-07

[07:20:36] dminuoso: has joined #ruby
[07:21:40] dminuoso: Im on nix and I have a bundle application picking up gems from `/home/dminuoso/.gem/...` which I cant figure out why.
[07:22:15] dminuoso: GEM_PATH is set correctly. What controls where ruby looks up gems?
[07:25:00] dminuoso: Like I said, GEM_PATH is set correctly, it doesn't list the above path.
[07:25:29] dminuoso: https://gist.github.com/dminuoso/c59efb68136b6f8e1f665125d709bfab
[07:25:51] dminuoso: Or mmm. Wait.
[07:27:22] dminuoso: havenwood: Nope
[07:27:35] dminuoso: havenwood: Also nope.
[07:28:06] dminuoso: havenwood: That prints the wrong directory indeed.
[07:30:08] dminuoso: havenwood: Mmm no, but I probably *should* use it.
[07:31:25] dminuoso: havenwood: Nope.
[07:31:32] dminuoso: Let me ask this differently.
[07:31:49] dminuoso: If I want to perfectly sandbox this application, no strings attached to global directories in `~/.gem` etc
[07:31:53] dminuoso: What's the canonical way?
[07:33:35] dminuoso: havenwood: I want them in some directory. Say the app directory.
[07:33:41] dminuoso: havenwood: Assume I have no global gem installed whatsoever.
[07:34:01] dminuoso: havenwood: How exactly is it "remembered"?
[07:34:07] dminuoso: Does it emit some local file?
[07:36:23] dminuoso: havenwood: Mmm, how much breakage would deleting all of ~/.gem cause?
[07:36:52] dminuoso: havenwood: No I actually mean deleting that directory ;)
[07:41:01] dminuoso: marz_d`ghostman: keep a reference to it.
[07:41:33] dminuoso: marz_d`ghostman: Once an element is unreachable, you might as well delete it because you cant refer to it anyway
[07:44:00] dminuoso: havenwood: Deleting the directory would have been faster..
[07:44:09] dminuoso: But it matters not.
[07:45:28] dminuoso: havenwood: Okay, so deleting all gems seems to have improved the situation. invoking bundle brings it into an unkillable state now.
[07:46:37] dminuoso: This is even more interesting now.
[07:49:46] dminuoso: havenwood: Is there a way to install a gem locally without bundler?
[07:50:02] dminuoso: I think I found the core issue here.
[07:50:34] dminuoso: havenwood: But that would install it into the global gem store at ~/.gem/, no?
[07:50:46] dminuoso: By locally I mean in a sandbox sense.
[07:51:44] dminuoso: So here is the problem
[07:51:53] dminuoso: I need to figure out how to install bundler appropriately.
[07:57:05] dminuoso: This fucking garbage piece of shit spring.
[07:57:11] dminuoso: 30 minutes wasted again.
[07:57:27] dminuoso: Thank you havenwood, as always.
[07:58:01] dminuoso: (Turns out the issue was long fixed, just had some spring running in the background..)
[07:58:53] dminuoso: so you still doing ruby instead of law stuff?
[07:58:58] dminuoso: Where did apeiros go to?
[09:12:42] dminuoso: marz_d`ghostman: What?
[09:12:51] dminuoso: marz_d`ghostman: I do not understand the question. Please rephrase.
[09:15:55] dminuoso: marz_d`ghostman: What do you mean by "when it doesn't"?
[09:18:26] dminuoso: marz_d`ghostman: In my experience its best to not rely on this behavior.
[09:18:47] dminuoso: marz_d`ghostman: Have the initialize of Dog require everything needed.
[09:18:58] dminuoso: marz_d`ghostman: Ah I see what you mean.
[09:19:25] dminuoso: marz_d`ghostman: Ruby has no compile time mechanisms telling you that your code is bad, other than a grammar check.
[09:19:40] dminuoso: You have to encode it into runtime checks and/or tests.

2019-05-10

[06:39:03] dminuoso: has left #RubyOnRails: ("WeeChat 2.2")

2019-05-09

[07:33:13] dminuoso: has joined #RubyOnRails
[07:34:35] dminuoso: Using simple_form I have an `simple_form_for model { |f| ... f.input :email_addresses, :input_html: { class: "selectize_mail" } }`, where email_addresses is an array field on my model.
[07:35:21] dminuoso: This produces an input field where the array is joined together with a space. What process decides how to serialize this array?

2019-04-23

[12:51:28] dminuoso: has joined #RubyOnRails
[15:56:13] dminuoso: has left #RubyOnRails: ("WeeChat 2.2")

2019-03-26

[09:03:03] dminuoso: Im trying to effectively build a phoenix app inside Docker and Im getting some bizarre problems about the phoenix digester not finding Jason: https://gist.github.com/dminuoso/6a855cfa153f2b2a422317f98fcf0c3d
[09:03:09] dminuoso: Can someone point out what might be going on here?
[09:06:49] dminuoso: (my mix.exs has a jason dependency)
[09:13:39] dminuoso: Wow! Okay I figured it out. The difference between copying from `foo/` and `foo`. :)
[15:52:04] dminuoso: has left #elixir-lang: ("WeeChat 2.2")

2019-03-24

[19:54:01] dminuoso: has left #ruby: ("WeeChat 2.2")

2019-03-21

[10:47:30] dminuoso: has joined #ruby
[11:02:11] dminuoso: Is there a canonical way to feed build flags into native gems?
[11:07:22] dminuoso: Specifically I see some mention of `gem install ... -- --build-flags [options]` but the behavior of those build flags is not clearly documented.
[13:33:03] dminuoso: adam12: Gotcha, I was already on that track patching a rather silly written library ruby-oci8 which simply fails to build on nix because the author thought it would be nice to deprecate and remove any dir_config controllable --with-oracle-instantclient flags..
[13:36:49] dminuoso: adam12: Ah that blows. Same library?
[13:37:36] dminuoso: At least LD_LIBRARY_PATH is patchable with no effort. On nix I dont even have /sbin and some packages have hardcoded paths for that..
[13:38:02] dminuoso: Not that Im trying to compare who is worse off..
[16:00:01] dminuoso: josevalim: Was that in RL?
[16:02:23] dminuoso: josevalim: What do you know about Elixir anyway. This guy is an expert.

2019-03-18

[14:14:16] dminuoso: ariedler_: redux is the easiest part of those, redux-thunk is a completely useless library that is not needed at all (people using or advertising is are just 100% proof they did not understand redux at all)
[14:15:38] dminuoso: nox: Redux is not too different from say GenServer in a sense. :)
[14:18:22] dminuoso: ariedler_: All it does for you is reinject dispatch. Guess what, connect already does that for you.
[14:18:50] dminuoso: ariedler_: It's a 14 LoC library that is used because Web developers seem to have this invisible barrier preventing them from understanding what they use.
[14:22:07] dminuoso: ariedler_: Essentially it boils down to: I have a store. How do I dispatch a message to it?
[14:22:50] dminuoso: ariedler_: It's like using a library to call a function for you.

2019-03-14

[08:21:25] dminuoso: Mmm. Why does Phoenix throw request body and URL params into one thing?
[08:21:33] dminuoso: This is rather annoying. :(
[08:24:47] dminuoso: I mean yeah I guess I can just pattern match on the conn and extract the body and params manually, it'd been much nicer if phoenix didn't pretend that throwing both into one argument was "the right thing to do"
[08:25:47] dminuoso: Nicd-: That's besides the point.
[08:26:16] dminuoso: Nicd-: Perhaps you want to preserve the body in shape.
[08:30:36] dminuoso: zakora: mix run?
[09:42:50] dminuoso: Does ecto have a way to f
[09:42:55] dminuoso: Does ecto have a way to find a record based on a changeset?
[11:22:05] dminuoso: Ecto queryables are constructed using `from u in "blah"`... what is that `in` inside there? Is that just a fragment of macro-based DSL?

2019-03-12

[07:26:57] dminuoso: duoi: Just use a database driver directly? Ecto is not necessary in any way you know.
[07:27:11] dminuoso: Oh actually the question came from cmk_zzz.
[07:35:10] dminuoso: cmk_zzz: SQL.
[07:35:25] dminuoso: I never understood why all the hipster web boys are so afraid of a domain specific language that is actually not so bad.
[07:35:48] dminuoso: Sure, the syntax is a bit verbose, but it directly translates to relational algebra.
[07:37:24] dminuoso: And in larger companies you may have database teams that know SQL but not this weird ecto macro magic.
[07:37:31] dminuoso: It's easy to reason about SQl.
[07:39:16] dminuoso: cmk_zzz: What is wrong with ecto?
[07:39:19] dminuoso: What are you looking for?
[07:39:30] dminuoso: Maybe start with your requirements and reasons for not liking ecto.
[10:12:52] dminuoso: cmk_zzz: ORM in elixir does not make much sense.
[10:13:39] dminuoso: cmk_zzz: I have come to my senses years ago and stopped relying on ORMs. They just get in the way, lead to terrible query generation, force you to figure out how to solve problems using badly-to-no documented languages..
[10:13:50] dminuoso: SQL is easier to learn.
[10:14:00] dminuoso: And it's not much more code to write SQL from hand
[10:14:33] dminuoso: dysfun: Instead you embed large macros in your file.
[10:14:37] dminuoso: Not sure what you have gained but okay.
[10:16:37] dminuoso: dysfun: you are mentally switching syntax anyway.
[10:17:08] dminuoso: the ecto query language is not really elixir

2019-03-11

[12:50:07] dminuoso: https://gist.github.com/dminuoso/ee59f93a72fee619d74d194b168310a5 <- can someone point out to me what is happening here? The erlang in my environment is Erlang/OTP 21.
[12:51:22] dminuoso: dysfun: Oh wait. You mean the hex2nix application itself?
[12:52:12] dminuoso: dysfun: Yes. I was under the impression that the nix package for hex2nix was not broken that it wouldn't do exactly this.
[12:54:58] dminuoso: dysfun: When I asked about "You mean the hex2nis application itself" I meant: "So you are saying that hex2nix is compiled using a different erlang than the ssl module in my nix store"?
[12:57:48] dminuoso: What is "an erlang"?
[13:00:21] dminuoso: dysfun: Okay I originally assumed as much, dismissed this because I was under wrong assumptioned.
[13:00:26] dminuoso: dysfun: I found the bug.

2019-03-08

[11:42:18] dminuoso: Mmm, not bad. I just segfaulted elixir.
[16:32:51] dminuoso: With Ecto, how can I emit queries that directly use Postgrex datatypes?
[16:33:32] dminuoso: Or do I really have to implement the Ecto.Type behavior in some shallow module that... doesnt do anything?
[22:49:54] dminuoso: Or maybe you are inserting a tuple that is 794MiB large.
[23:01:02] dminuoso: danieli: Im trying to compensate for the lack of specificity in their question.

2019-03-06

[07:25:43] dminuoso: Mmm. Given a phoenix app with migrations, is there an elegant approach to triggering rollbacks through say gitlab-ci?
[07:27:12] dminuoso: I feel that I should be tracking the ecto version in a file in my repo, and then have the deploy script detect whether a migrate or rollback is needed.
[08:22:10] dminuoso: OliverMT: I have the advantage that downtime is acceptable in migration time (this is kind of crucial, since it avoids all kinds of consistency issues that would arise)
[08:22:31] dminuoso: OliverMT: Where do you propose these actions are carried out? Directly inside ecto migrations?
[11:50:58] dminuoso: OliverMT: How do you do rollback/migrate detection? (It would be wonderful to have a singular migrateTowards command that works in both directions)

2019-03-05

[11:04:56] dminuoso: dysfun: "Where is *the* code that..." suggests that there is some canonical code that provokes that error message. Surely kapil____'s code is not the canonical code here.
[11:05:05] dminuoso: ACTION nitpicks back
[14:33:48] dminuoso: dch: It's not about "QT is too hard". Having to install a Qt application just to use some service is complicated.
[14:34:27] dminuoso: dch: What about dependencies? Suddenly you are looking at shipping an entire C++ runtime and half a dozen other libraries. How will that conflict with existing libraries?
[14:36:44] dminuoso: dch: Oh fair enough.
[14:36:55] dminuoso: dch: vscode and other electron apps is just.. ah well.
[14:38:05] dminuoso: dch: Unless you are on nix the linux concept of shared library is downright horrible.
[14:38:08] dminuoso: It's extremely brittle.
[14:38:23] dminuoso: It's a recipe of "oh I switch out this library and 3 applications break"
[14:39:24] dminuoso: nox: heh, my emacs uses 240MiB right now.
[14:41:02] dminuoso: dch: My slack uses 140 residential memory.
[14:41:09] dminuoso: So it's not "GiB of ram"
[14:43:03] dminuoso: dysfun: The virtual memory is irrelevant.
[14:44:06] dminuoso: dysfun: virtual memory includes shared libraries and memory that is not paged in.
[14:44:36] dminuoso: dysfun: Im not talking about swapped memory.
[14:45:49] dminuoso: And the residential memory includes shared memory too. So the actual footprint of some random process is much smaller.
[14:46:43] dminuoso: dch: is that executable size?

2019-01-14

[07:44:53] dminuoso: has joined #ruby
[07:46:40] dminuoso: has left #ruby: ("WeeChat 2.0.1")

2019-01-07

[11:33:29] dminuoso: has joined #ruby
[11:33:35] dminuoso: has left #ruby: ("WeeChat 2.0.1")
[14:57:05] dminuoso: has joined #ruby
[14:57:15] dminuoso: has left #ruby: ("WeeChat 2.0.1")

2018-11-23

[06:31:26] dminuoso: has joined #ruby
[06:31:41] dminuoso: This is ruby for you.
[06:31:41] dminuoso: NameError: undefined local variable or method `getXTime' for main:Object; Did you mean? getXTime
[06:44:03] dminuoso: The right way.
[06:44:15] dminuoso: Where is apeiros. I need to complain some.
[07:55:02] dminuoso: has left #ruby: ("WeeChat 2.0.1")

2018-11-22

[07:12:00] dminuoso: has joined #ruby
[07:12:11] dminuoso: has left #ruby: ("WeeChat 2.0.1")

2018-11-15

[19:43:12] dminuoso: ivanskie: I dont understand the question.
[19:43:17] dminuoso: Just return it?
[19:44:03] dminuoso: begin ... rescue StandardError => e; return e.backtrace; end
[19:46:26] dminuoso: ACTION does not understand the question or the probilem
[19:46:28] dminuoso: ACTION does not understand the question or the problem
[20:37:30] dminuoso: has left #ruby: ("WeeChat 2.0.1")

2018-11-14

[12:20:48] dminuoso: has joined #ruby
[13:24:39] dminuoso: has joined #RubyOnRails
[13:24:49] dminuoso: has left #RubyOnRails: ("WeeChat 2.0.1")
[13:36:10] dminuoso: baweaver: where is he?
[15:31:03] dminuoso: has left #ruby: ("WeeChat 2.0.1")
[16:44:39] dminuoso: has joined #ruby
[16:44:51] dminuoso: havenwood: where is apeiros :<
[16:44:56] dminuoso: Need to make fun of him

2018-08-30

[19:49:26] dminuoso: has left #ruby: ("WeeChat 2.0.1")

2018-08-20

[05:53:11] dminuoso: sevenseacat: 1. Delete specs. 2. watch failing specs count go down. 3. Profit
[05:53:17] dminuoso: Less work, more fun.
[09:02:11] dminuoso: ACTION gives za1b1tsu a docker
[09:47:38] dminuoso: dionysus69: asynchronous has nothing to do with REST.
[09:48:38] dminuoso: dionysus69: well yeah, but that has nothing to do with ajax.
[09:49:19] dminuoso: dionysus69: while some classical http might do something like: Request -> Result, ajax just turns it into: Request -> Promise Result
[09:49:30] dminuoso: It's still HTTP with all its semantics.
[09:49:41] dminuoso: The thing that changes is how you deal with responses in your client-code.
[14:02:57] dminuoso: amperry: Personally I recommend not making this a rails problemn
[14:03:31] dminuoso: amperry: Writing a simple 10 line bash script?
[14:04:48] dminuoso: amperry: The one line entry will just start a script, the script probably wont be a one-liner.
[14:08:33] dminuoso: amperry: Consider that you want at minimum: Detect running state. Cleanup if necessary. Pushing into prometheus/syslog the state that you had to kill and respawn. Do the respawn action.
[14:14:35] dminuoso: amperry: You shouldn't just probe for the PID. Scrabe the webserver.C
[14:14:48] dminuoso: amperry: The process might hang or possibly starved out of ressources.
[14:16:24] dminuoso: *scrape even.
[14:16:48] dminuoso: amperry: So use curl/wget or something along the lines. Ensure you get a 200.
[14:21:15] dminuoso: amperry: through what mechanism do you bring your server to live?
[14:21:40] dminuoso: amperry: Do you use upstart? systemd? Or perhaps do you have a docker based setup?
[14:22:55] dminuoso: amperry: you can make your life easy and ship a docker container then.
[14:23:06] dminuoso: amperry: it provides for a much cleaner solution to most problems.
[14:23:23] dminuoso: amperry: the idea of "it died" can be resolved with "throw the container away and make a new one"
[14:24:16] dminuoso: amperry: It also removes issues such as "but it works on my machine"
[20:40:30] dminuoso: has left #RubyOnRails: ("WeeChat 2.0.1")
[20:40:38] dminuoso: has left #ruby: ("WeeChat 2.0.1")

2018-08-17

[07:47:12] dminuoso: za1b1tsu: Ask yourself what the problem is.,
[07:47:24] dminuoso: za1b1tsu: When your app cant load its dependencies, do you think it's problematic?
[09:39:11] dminuoso: dionysus69: I dont think it's a memory leak.
[09:39:43] dminuoso: You should probably tap into ObjectSpace, trace allocations
[09:39:45] dminuoso: Do some shenanigans.
[09:40:12] dminuoso: I suspect it might be some sub-optimal caching behavior.
[09:40:49] dminuoso: dionysus69: https://ruby-doc.org/stdlib-2.5.1/libdoc/objspace/rdoc/ObjectSpace.html#method-c-trace_object_allocations
[09:41:11] dminuoso: dionysus69: You have to dig very hard through objectspace I suspect.
[13:07:41] dminuoso: Criten: Stupid comments from my working colleague.

2018-08-16

[13:11:46] dminuoso: dionysus69: With EC2 and 4TiB RAM your server will survive for a long time.
[13:37:39] dminuoso: dionysus69: That does not sound like a memory leak.
[15:24:55] dminuoso: jeromelanteri: There are some people that frequently use this channel to avoid learning Ruby or programming in general themselves.
[15:25:42] dminuoso: jeromelanteri: That person is such an example, and I strongly refuse to assist their behavior.