« Back to channel list

#elixir-lang - 11 April 2019

« Back 1 day Forward 1 day »
[00:23:29] proteusguy: has joined #elixir-lang
[00:30:25] nickjj_: has joined #elixir-lang
[00:31:00] craigp_: has joined #elixir-lang
[00:31:54] threadj: has joined #elixir-lang
[00:31:56] Jam666_: has joined #elixir-lang
[00:32:07] ur5us_: has joined #elixir-lang
[00:32:32] blahdodo: has joined #elixir-lang
[00:33:43] traxo: has joined #elixir-lang
[00:34:10] edmz: has joined #elixir-lang
[00:35:22] teepark: has joined #elixir-lang
[00:37:02] Whipstickgostop: has joined #elixir-lang
[00:37:07] __charly__: has joined #elixir-lang
[01:06:48] carldd: has joined #elixir-lang
[01:30:47] duaneb: has joined #elixir-lang
[01:35:31] Saukk: has joined #elixir-lang
[01:53:47] tomterl: has joined #elixir-lang
[02:11:08] nadsat: has joined #elixir-lang
[02:49:02] ariedler: has joined #elixir-lang
[03:20:34] carldd: has joined #elixir-lang
[03:38:37] Moondhum: has joined #elixir-lang
[03:50:40] DTZUZO: has joined #elixir-lang
[03:58:22] wsieroci: has joined #elixir-lang
[04:02:44] craigp: has joined #elixir-lang
[04:10:20] mdbm: has joined #elixir-lang
[04:23:59] kapil____: has joined #elixir-lang
[04:29:18] Phylock: has joined #elixir-lang
[04:37:01] mbuf: has joined #elixir-lang
[04:40:44] sevenseacat: has joined #elixir-lang
[04:42:41] mbuf: has joined #elixir-lang
[04:56:41] gvaughn: has joined #elixir-lang
[05:14:53] mdbm: I read from a book the use of: ":file.format_error(error)"
[05:15:13] mdbm: there is no way to use the Elixir module?
[05:15:26] mdbm: (:file is the Erlang module to my understanding)
[05:23:16] Nicd-: if the Elixir stdlib or some library has that kind of function, you can use it
[05:23:28] Nicd-: but there is no shame in using Erlang libraries, they exist to be used
[05:23:43] Nicd-: for example `:ets` is used a lot
[05:24:09] Nicd-: Elixir builds upon Erlang and there is no sense in reimplementing things that have been done well in Erlang already
[05:24:32] mdbm: Nicd-, what about File.open, this was not implemented in Erlang?
[05:24:52] Nicd-: it might have been implemented in a way that is clumsy to use from Elixir
[05:25:18] Nicd-: for example Erlang using different kind of strings or having a different argument order makes wrapping Erlang libraries often worthwhile
[05:26:50] mdbm: Nicd-, this is where I have to look for the API? https://hexdocs.pm/elixir/Kernel.html
[05:27:23] Nicd-: not necessarily in Kernel, but yes, those docs contain the Elixir stdlib
[05:27:24] mdbm: this is the most official api docs?
[05:30:43] mdbm: Nicd-, bit harder to find the erlang API documentation, I have this kind of portal: https://www.erlang.org/docs
[05:31:34] Nicd-: try https://erldocs.com/
[05:32:36] Nicd-: this also seems to have search: http://erlang.org/doc/search/
[05:34:36] sms: mdbm: There's builtins to work with files in Elixir yes
[05:34:37] mdbm: Nicd-, thanks, I see that :file.format_error returns an Erlang string (which is thus a charlist). So wasn't that a good reason to implement it in Elixir so that the function returns a binary string?
[05:34:50] sms: https://hexdocs.pm/elixir/File.html
[05:35:58] Nicd-: mdbm: if you would like it in the stdlib, file an issue and you can either get it included or get a reasoning why not. I don't call the shots over what goes in stdlib, the core team makes that judgement based on their criteria
[05:36:41] sms: Oh, you want that thing specifically
[05:36:58] Nicd-: it's not just about strings, it's also about stdlib design, how to keep it coherent and minimal while useful
[05:50:59] lexmag: has joined #elixir-lang
[06:10:33] gvaughn: has joined #elixir-lang
[06:19:20] iamvery: has joined #elixir-lang
[06:32:09] PragTob: has joined #elixir-lang
[06:34:37] mdbm: just experimenting with functions, something wrong here, can't figure out: https://pastebin.com/raw/hB8utD4F
[06:48:38] mdbm: actually my function gives a compile error it seems
[06:50:17] ariedler: has joined #elixir-lang
[06:51:05] mdbm: https://pastebin.com/AGKmN16g
[06:51:43] sevenseacat: you can't pattern match on function heads like that
[06:52:48] mdbm: sevenseacat, what do you mean by function head?
[06:55:00] sevenseacat: also not sure you can have a recursive anonymous function - how can you call map when you haven't yet defined map
[06:55:09] HendrikPeter: has joined #elixir-lang
[06:56:39] sevenseacat: as in, pattern matching on the data you're passing to your function directly
[07:10:48] CornishPasty: Wait does Elixir *still* not have R17 named functions?
[07:11:03] starbelly: it's pretty much the same as an erlang, just diff keywords for the functions
[07:11:32] starbelly: https://www.irccloud.com/pastebin/TpRmjmiA/anon_multiple_function_head.ex
[07:12:27] CornishPasty: starbelly: that's not recursive?
[07:14:26] sevenseacat: oh I didn't know you could do that nowadays!
[07:19:23] squall: has joined #elixir-lang
[07:25:58] starbelly: Yeah, and the recursive function bit... it's just not as nice as in erlang
[07:26:45] starbelly: iex(1)> map = fn ({[]}) -> []
[07:26:45] starbelly: ...(1)> ({fun, [head | tail]}) -> [fun.({head})] ++ fun.({fun, tail})
[07:26:45] starbelly: ...(1)> end
[07:27:11] starbelly: then you say `map.({map, [1,2,3]})`... the arguments in there are wrong, but yeah, POC
[07:27:12] Sgeo_: has joined #elixir-lang
[07:28:06] starbelly: The reason I'm using a tuple as well, because I believe in this case the arity must be the same for each head
[07:30:57] gvaughn: has joined #elixir-lang
[07:31:04] HendrikPeter: has joined #elixir-lang
[07:32:49] starbelly: https://www.irccloud.com/pastebin/4SIYBsue/maybe.ex
[07:34:17] starbelly: Of course, there's no rule that says you can't use erlang in your elixir project 😉 Well... except maybe your company... 🤔
[07:35:35] starbelly: i.e., mkdir src and 🚀
[07:35:49] 59NAAMAK0: has joined #elixir-lang
[07:42:15] starbelly: ~ mix new luke
[07:42:15] starbelly: * creating README.md
[07:42:15] starbelly: * creating .formatter.exs
[07:42:16] starbelly: * creating .gitignore
[07:42:16] starbelly: * creating mix.exs
[07:42:40] starbelly: has joined #elixir-lang
[07:43:43] starbelly: ACTION hangs head in shame 
[07:49:14] k1nd0f: has joined #elixir-lang
[08:02:29] k1nd0f: has joined #elixir-lang
[08:05:13] Sgeo_: has joined #elixir-lang
[08:07:55] iamvery: has joined #elixir-lang
[08:08:42] snapet: has joined #elixir-lang
[08:13:19] iamvery: has joined #elixir-lang
[08:14:24] mdbm: starbelly, why was my code incorrect?
[08:15:40] starbelly: It was not, and actually, in your example, you don't need the tuples... I think I was confused about why you were doing fun.(head) when there's no single arity clause
[08:15:58] mdbm: starbelly, it doesn't work: https://pastebin.com/AGKmN16g
[08:16:53] starbelly: Yeah, you have to do something like the one I did... where you pass the anon function itself
[08:17:02] starbelly: not as nice as in erlang
[08:17:39] starbelly: but that will fail anyway, no? the [fun.(head)] bit
[08:17:52] mdbm: starbelly, dunno, I'm noob
[08:18:06] mdbm: starbelly, seems correct to me :D
[08:18:13] ur5us: has joined #elixir-lang
[08:19:22] starbelly: https://www.irccloud.com/pastebin/HcrY5d7y/foo.ex
[08:20:30] starbelly: You have to do that ^ in elixir, would be nice if you could do it erlang style though
[08:20:43] lpil: I wish we had named anon functions
[08:23:02] starbelly: ACTION notes gleam is on his list 
[08:23:06] lexmag: has joined #elixir-lang
[08:23:22] iamvery: has joined #elixir-lang
[08:24:33] ur5us: has joined #elixir-lang
[08:28:24] dysfun: ACTION notes it's still not a lisp
[08:28:34] starbelly: ^ true story
[08:28:48] starbelly: Viva la LFE!
[08:28:58] dysfun: no, fuck common lisp style lisps
[08:29:18] dysfun: at least joxa looks like clojure
[08:29:46] starbelly: I guess... what's so great about clojure? I mean, lispish wise?
[08:31:07] infowolfe: has joined #elixir-lang
[08:31:07] infowolfe: has joined #elixir-lang
[08:31:46] dysfun: well in this case, there are a lot fewer parens, so it's easier to read
[08:31:48] lpil: I've never used a typed lisp. Maybe Gleam would be a lisp if I had
[08:32:17] dysfun: but in general, clojure was the first lisp to come with efficient immutable collections
[08:32:31] starbelly: Hmmm... I'm reading clojure is a lisp-1... so I'm confused
[08:33:16] dysfun: well, lisp-1 only really means "single namespace", but people often use it to mean "like scheme" (as opposed to "like common lisp")
[08:33:52] iamvery: has joined #elixir-lang
[08:34:08] dysfun: elixir is a lisp-2, if you ignore it not being a lisp
[08:34:42] dysfun: clojure is a lisp-1 in the sense of single namespace
[08:35:01] starbelly: but how does this affect things?
[08:35:17] starbelly: as an engineer/dev/whatever
[08:35:17] lpil: Would you say Elixir is a lisp? :)
[08:35:56] starbelly: Some people do say that... and arguably, perl is a lisp-2, ruby is a lisp-2, etc.
[08:36:01] lpil: ACTION starts writing Elixir using the raw AST
[08:36:02] dysfun: starbelly: def foo(foo), do: foo.(&foo) # elixir is "lix-2"
[08:36:17] dysfun: that should be &foo/1
[08:36:50] dysfun: in a "lix-1" that would be def foo(bar), do: bar(foo)
[08:38:05] dysfun: so for example clojure, (def foo [bar] (bar foo)) vs hypothethical lisp-2 clojure: (def foo [foo] (foo #'foo))
[08:38:36] dysfun: or somesuch
[08:38:53] dysfun: the point is that values and functions do not reside in the same namespace, you need to transfer between them with some syntax
[08:38:58] lexmag: has joined #elixir-lang
[08:38:59] dysfun: that's a lisp-2 thing
[08:39:25] starbelly: yup, grokked that
[08:39:41] dysfun: but this is like the least important thing tbh
[08:39:57] starbelly: yeah, seems like a wallflowers type thing
[08:40:15] dysfun: my reasons for liking clojure were that it removes a lot of unneccessary parens, macros and the immutable data structures
[08:40:34] dysfun: and no, elixir macros are not at all comparable to clojure macros in terms of usability
[08:40:41] gvaughn: has joined #elixir-lang
[08:41:11] starbelly: And what about macros in LFE?
[08:41:38] dysfun: there are nice and terrible things about them
[08:41:51] dysfun: it doesn't make any pretence of hygiene, which is both nice and terrible
[08:42:39] dysfun: they're real lisp macros though
[08:42:50] starbelly: Yeah, maybe in the erlang spirit though? That is to say... it's good to break out of purity when real world problems require it.
[08:43:04] dysfun: yes, lfe is very in the erlang spirit
[08:43:13] dysfun: but it doesn't start off so far from elixir
[08:43:23] starbelly: ACTION is still just learning about lisps, etc. 
[08:43:31] dysfun: they both have this model of an interpreted computation that builds up a module
[08:44:38] dysfun: (this one seems to have appeared first in joe armstrong's erl2)
[08:44:50] lpil: Are they real lisp macros? I've not used LFE much but a user told me that the macro language is a restricted subset of the runtime language, which didn't seem very lisp to me
[08:45:14] dysfun: they're real lisp macros
[08:45:23] starbelly: So, to avoid that, sounds like you'd have to compile to core or or to beam byte code? I guess, are the limitations per compiling to erlang?
[08:45:34] dysfun: there are a few annoyances. i never did persuade rvirding to add gensym of any kind
[08:45:50] wonko7: has joined #elixir-lang
[08:45:52] dysfun: (because of atom table exhaustion, but he wouldn't consider some slightly hacky solutions)
[08:46:07] lpil: I've just realised who you are
[08:46:12] lpil: Haha, hi!
[08:46:17] dysfun: i considered forking lfe until i got into elixir
[08:46:20] dysfun: hi lpil :)
[08:46:26] dysfun: took you a while :)
[08:46:36] starbelly: ACTION has no idea who you are... but you smell like a fish 
[08:46:49] lpil: I doing recognise you without your usual excellent Twitter handles
[08:46:52] dysfun: ACTION knows lpil
[08:46:58] lpil: I don't*
[08:47:10] nox: dysfun is a rageful person, which is why we appreciate each other.
[08:47:13] dysfun: hehe, they're just whatever seems amusing to me in the moment
[08:47:14] lpil: We met at a NYE party many years ago.
[08:47:20] dysfun: haha and what a party
[08:47:56] nox: "10:34 <dysfun> elixir is a lisp-2, if you ignore it not being a lisp" lol
[08:48:07] mdbm: has joined #elixir-lang
[08:48:10] dysfun: oh shush nox, i have a headache already
[08:48:11] nox: I was going to write angry words about how Elixir is not homoiconic, but you got that covered.
[08:48:24] dysfun: haha, elixir used to advertise itself as homoiconic
[08:48:29] dysfun: then 'nearly-homoiconic'
[08:48:31] dysfun: then they gave up
[08:49:01] nox: I know, I was young and would yell about tech instead of yelling about people.
[08:49:53] starbelly: so many james' in this world
[08:50:40] dysfun: there were 3 in my class at school
[08:51:29] ariedler: has joined #elixir-lang
[08:53:38] starbelly: that's two too many
[08:55:37] dysfun: it sure is
[08:55:48] nox: I was always the only Anthony at school, which is great.
[08:56:03] starbelly: But there's a lot of Anthony's in this world...
[08:56:36] starbelly: The world's namespace is polluted ☹️
[08:56:50] dysfun: yes, our ancestors didn't know about uuids
[08:57:06] nox: starbelly: I'm French so it's easier to avoid the others.
[08:57:13] nox: Not that common of a name here.
[08:57:25] starbelly: nox: I did not know you were french... and yes would agree, not common
[08:57:26] dysfun: anthonie* #ftfy
[08:58:11] nox: dysfun: Lol.
[08:58:38] starbelly: ACTION likes french and Europeans for that matter... and Canadians
[08:59:07] dysfun: i'm sure you can make an exception for nox
[08:59:25] nox: https://irccloud.mozilla.com/file/vGowoIC6/Capture%20d%E2%80%99e%CC%81cran%202019-04-11%20a%CC%80%2010.59.09.png
[08:59:32] starbelly: Perhaps :) But I do like what interactions I've had thus far
[08:59:33] nox: I should wear a béret to make it more obvious I guess.
[08:59:53] dysfun: you forgot the red wine
[09:00:16] nox: The red wine was in my Erlang award thanks video.
[09:00:34] starbelly: ACTION tends to get along with people outside the america 🤷‍♂️
[09:00:40] dysfun: i don't suppose they have boursin in france?
[09:00:54] nox: We do, but most boursin is #fakecheese.
[09:01:04] dysfun: yeah, that's why i assumed you wouldn't have it
[09:01:19] dysfun: however, i quite liked the "du pain, du vin, du boursin" adverts
[09:01:22] nox: I.e. you can find some similar which is not it, but "boursin" as a product is fake cheese.
[09:01:39] nox: Like babybel and stuff like that.
[09:01:48] dysfun: but hey, you even have macdonalds being popular these days
[09:02:03] starbelly: Royale with cheese
[09:02:16] nox: dysfun: Always been popular.
[09:02:52] dysfun: "ce n'est pas un fromage"
[09:03:09] nox: Even at the heights of ad campaigns against junk food it was still popular, though they now do more organic food and whatnot.
[09:03:35] dysfun: in spain, they have gyms attached
[09:03:57] Beam`: has joined #elixir-lang
[09:05:18] nox: dysfun: lol
[09:05:59] starbelly: Bon soir regret à demain?
[09:10:39] kyrylo: has joined #elixir-lang
[09:10:57] starbelly: Yoann Vandoorselaere 🤔
[09:14:28] lexmag: has joined #elixir-lang
[09:15:16] rawtaz: oh my, what happened to english, is it dead?
[09:15:44] nox: I can't wait to finally write my code in French like it should be.
[09:15:44] starbelly: Yeah, the french have taken over, everything
[09:15:48] dysfun: no, but it winds nox up when we speak french badly
[09:15:57] nox: dysfun: Shhhh
[09:16:54] starbelly: Mange moi je suis le twinkie
[09:17:24] starbelly: 🤷‍♂️
[09:17:28] nox: Believe me, when people speak French badly they do it way worse than you.
[09:17:46] dysfun: i refuse to believe you are a parisian
[09:18:16] nox: dysfun: What?
[09:18:22] starbelly: ACTION only knows those two lines in french, which are probably incorrect
[09:18:37] dysfun: parisians have a reputation for chewing people out for minor mistakes
[09:19:24] lexmag: has joined #elixir-lang
[09:20:39] starbelly: ^ smells like war
[09:22:09] nox: dysfun: I'm too old for that shit.
[09:24:45] dysfun: no argument from me
[09:24:57] nox: dysfun: I'm too busy being extremely angry at electric scooters, as a Parisian.
[09:28:16] mdbm: IEx will not throw an error if I write: &Math.blah/5
[09:28:28] mdbm: even if Math.blah doesn't exist
[09:34:25] starbelly: ^ true story
[09:35:01] dysfun: itym "iex will catch errors"?
[09:35:49] mdbm: dysfun, I don't see any error
[09:36:00] lpil: Should there be an error?
[09:36:45] dysfun: not until it's used
[09:36:54] lpil: That's what I thought
[09:36:56] mdbm: lpil, why shouldn't there be? ;p fun = &Math.blah/5 doesn't throw an error, while the module Math clearly doesn't define any "blah" function
[09:38:05] lpil: Because in Elixir these things are checked when they are used. Like aliases
[09:38:24] lpil: Elixir is a very dynamic language
[09:38:26] starbelly: `foo = fn(args) -> apply(Math, :blah, args) end` something like, which is why, the same is true of erl... ` Eh = fun(args) -> apply(math, blah, args) end`
[09:38:33] starbelly: something like that
[09:39:00] mdbm: alright thank you:)
[09:39:10] starbelly: n/p 👍
[09:39:53] mdbm: lpil, so is_function(&Math.blah/5) returning true is normal too?
[09:40:20] dysfun: it's syntax sugar
[09:40:28] dysfun: quite a lot of elixir is like that if you peer deeply
[09:41:36] starbelly: dynamic calls hurt :(
[09:41:55] dysfun: static typing rules
[09:42:24] starbelly: ACTION keeps hearing that
[09:42:39] starbelly: My only reference is C
[09:42:49] dysfun: yeah, that doesn't rule
[09:43:04] lexmag: has joined #elixir-lang
[09:44:00] dysfun: fortunately, rust is more than capable of doing everything i'd want c for these days
[09:44:19] mdbm: dysfun, static typing rules but still using Elixir though? :O
[09:44:49] dysfun: well i spend an average of 20 hours a week being paid as an elixir developer
[09:45:35] dysfun: i wanted to say "writing elixir" there, but actually, when you take out meetings and such, i don't
[09:46:18] OliverMT: I spend about 30 hours a week doing meetings :(
[09:46:21] OliverMT: #life-of-the-architect
[09:46:45] dysfun: sounds devops as fuck
[09:47:54] starbelly: sounds like agilescrumbanfooish to me
[09:48:05] lexmag: has joined #elixir-lang
[09:52:18] starbelly: Let me tell you something about TPS reports 😉
[09:52:53] mrus: what's a good way to iterate over an array (`[]`) of maps, with a parameter that's being passed in, and call a function for each map with that parameter, which in turn returns an updated version of that parameter that needs to be used for the next iteration? Sorry, if that question sucks btw.
[09:53:56] gvaughn: has joined #elixir-lang
[09:54:20] mrus: I was considering a comprehension, but I can't see how to get that return value from each call and use it as parameter in the next one
[09:55:21] mrus: so in the end I might just stick with a function that calls itself. Or is there a more elegant way?
[09:55:21] starbelly: You mean like a foldl?
[09:55:30] starbelly: If so, Enum.reduce/3
[09:58:42] starbelly: `Enum.reduce([%{eh: :meh}, %{meh: eh}], %{}, fn(x, acc) -> Map.merge(acc, x) end)`
[09:59:18] starbelly: You are not limited to just that though, you can have any type of accumulator.
[10:00:00] starbelly: `Enum.reduce([%{eh: :meh}, %{meh: eh}], {%{}, 0}, fn(x, {acc, count}) -> {Map.merge(acc, x), count + 1} end)`
[10:00:17] mrus: starbelly: `Enum.reduce([1, 2, 3, 4], fn x, acc -> x * acc end)` hm... how would I pass an additional parameter there? So, I have two things initially: That list `[1, 2, 3, 4]` and a parameter, e.g. `state`. Now I need to start by passing both variables and have the reduce call a function like modified_state = modify_state(state, list_item). Then forr the next list_item I need the modified_state from
[10:00:23] mrus: the previous one.
[10:00:43] starbelly: yeah, use a tuple, like the count example above
[10:00:57] starbelly: or ya know, use a map, or whatever is going to work for you
[10:02:02] mrus: ah, and fn would then need to return the same tuple I use initially, but with updated values?
[10:02:21] nox: 11:42 <starbelly> My only reference is C
[10:02:39] nox: Well, unless you are a scientist or a cowboy with horses, why even use K or F anyway?
[10:03:31] starbelly: `Enum.reduce([1,2,3,4], {[], nil}, fn(x, {acc, last_val}) -> {(acc * x) * last_value, x} end)`
[10:03:33] nox: 11:44 <mdbm> dysfun, static typing rules but still using Elixir though? :O
[10:03:51] starbelly: nox: No horses... no cowboy hat.
[10:03:56] nox: Elixir can stay unityped, but it could benefit from a new Erlang VM written in Rust, and that cannot be written in an unityped language.
[10:04:09] nox: starbelly: Amen to that.
[10:04:24] starbelly: yeah, I fancy not having types in erlang actually... types feel defensive, so...
[10:04:44] starbelly: I realize they save a lot of time in dev, etc.
[10:05:00] starbelly: but they don't help me with the hard problems... transient bugs
[10:05:01] mdbm: nox, Erlang VM is written in C?
[10:05:32] starbelly: mdbm: There are several alternative rust implementations going on.
[10:05:35] starbelly: good stuff.
[10:05:37] mdbm: nox, can it be a reality? that it be rewritten in rust
[10:05:38] nox: Rust would avoid that: https://github.com/erlang/otp/commit/6f9c07ae2694a2dc1f721fd10af22b8813d15bc1
[10:05:54] nox: There are a few unresolved questions, notably how to write a direct threaded emulator loop in Rust,
[10:05:58] nox: but it's definitely doable.
[10:06:09] nox: (https://en.wikipedia.org/wiki/Threaded_code#Direct_threading)
[10:06:16] mdbm: nox, what'd be the reason for the switch? is rust more performant?
[10:06:22] nox: That's done in "C" with a GCC extension (computed gotos).
[10:06:31] nox: mdbm: Security, safety, ease of maintenance.
[10:06:57] nox: starbelly: I'm a bit sad I don't have time to look at them. :(
[10:07:16] starbelly: me too... absolutely not enough time :(
[10:07:39] nox: starbelly: I have a nam repo on my computer but I'm probably never going to finish this. :(
[10:07:50] nox: (nox' abstract machine, following the naming traditions.)
[10:07:58] starbelly: nox: Well, best not to say never... better to say... one day :)
[10:08:28] starbelly: I don't see how people find the time... they are young and single me thinks.
[10:08:36] nox: Nah, I'll be a worldwide-known comedian before I finish this.
[10:10:09] starbelly: but none the less... I have hope... that I will find the time. Best I can do.
[10:10:27] nox: Isn't there one based on cranelift?
[10:10:37] mrus: starbelly: thank you :)
[10:10:51] nox: Nope, I dreamt that.
[10:11:08] starbelly: mrus: You're welcome :)
[10:11:28] nox: a CraneLift-baked Erlang VM would be so cool.
[10:11:31] starbelly: hmm cranelift... interesting... added to the ever growing list...
[10:12:45] nox: starbelly: If you want to learn Rust with bite-sized crates, I suggest reading through mitochondria, moite_moite, rayon_croissant and arbalest. :P
[10:12:55] mdbm: why when I execute a file, it returns the atom :ok ?
[10:12:56] nox: The fact that I wrote all of them is pure coincidence of course. :P
[10:13:20] nox: ACTION goes afk to prepare to go to lunch.
[10:13:40] starbelly: ACTION is about to go to bed
[10:13:51] starbelly: mdbm: What do you mean execute a file?
[10:14:07] mdbm: starbelly, sorry I say wrong
[10:14:10] mdbm: starbelly, IO.puts Math.zero?(1)
[10:14:18] nox: starbelly: Which timezone are you in?
[10:14:20] mdbm: it returns false followed by atom :ok
[10:14:37] mdbm: where does that atom come from?
[10:14:41] starbelly: nox: US CST... so up way too late, had trouble sleeping
[10:14:41] nox: IO.puts returns ok on success IIRC.
[10:15:08] mdbm: ah right
[10:15:25] mdbm: it prints and return a value
[10:15:36] mdbm: and IEx prints both printed value and returned value
[10:15:53] starbelly: Yeah, and the ok actually may bubble from erlang... sending a message to the group leader as a broadcast, but I'd have to look
[10:16:16] mdbm: starbelly, that still sounds chinese for me for now:)
[10:17:10] starbelly: Well for now, just know, it returns ok immediately if it doesn't bork before trying to send the message to io
[10:17:30] nox: So what you mean is that it made perfect sense to you, as it was as legible as the most spoken language in the world?
[10:17:54] starbelly: ok, people, bbl 💤
[10:20:47] mdbm: starbelly, see you and thanks for the help
[10:32:33] Nicd-: in Finland if something is beyond our understanding, we say it's "total Hebrew"
[10:34:30] mdbm: Nicd-, in French we say it's Chinese:) not sure if Englishmen say the same
[10:35:09] Nicd-: they might say "it's Greek to me"
[10:35:09] griffinbyatt: has joined #elixir-lang
[10:35:13] Nicd-: apparently
[10:36:50] Gazler: has joined #elixir-lang
[10:39:37] mdbm: has joined #elixir-lang
[10:52:18] ariedler: has joined #elixir-lang
[10:52:39] mdbm_: has joined #elixir-lang
[10:54:15] nox: I know, I’m French. It’s a bad expression in my opinion that’s all.
[10:55:08] ariedler: has joined #elixir-lang
[10:55:27] lexmag: has joined #elixir-lang
[11:01:08] iamvery: has joined #elixir-lang
[11:06:43] gvaughn: has joined #elixir-lang
[11:08:28] lexmag: has joined #elixir-lang
[11:11:34] __bluebell__: has joined #elixir-lang
[11:17:01] chris412: has joined #elixir-lang
[11:17:06] kyrylo: has joined #elixir-lang
[11:18:13] chris412: I'm interested in exploring elixir to manage the distribution of the data I'm holding in multiple nodes and calling python modules to perform data analysis on it
[11:19:31] dysfun: sounds good. do you have a particular question?
[11:20:31] huynhlv54: has joined #elixir-lang
[11:21:02] chris412: yes, Im looking for something like riak core to manage the distribution of the data but it looks like it's not being developed anymore
[11:21:34] chris412: What I'm picturing is a way to distribute my data and python analysis tools across a cluster
[11:21:37] dysfun: it's mostly pretty stable, but it is still maintained
[11:21:52] dysfun: well your python analysis tools you will want to spin up with something like erlexec
[11:22:12] chris412: From what you know about elixir and riak, do you feel it's appropriate for the application?
[11:22:47] chris412: Elixir's entire job will be ensuring that the algorithms for the time series data are executed locally where the data is stored
[11:22:57] dysfun: i'm not a riak user, but i will say that quite often what makes a good machine to run an elixir layer on doesn't make a good machine for hard compute
[11:23:28] chris412: The computation will be done in python
[11:23:40] chris412: What's an ideal machine for elixir?
[11:23:42] dysfun: yes, i understand, i'm talking about the hardware you run it on
[11:24:01] chris412: As in it should not be bare metal?
[11:24:13] chris412: I mean it should be bare metal?
[11:24:28] dysfun: no, that's orthogonal
[11:24:46] dysfun: even on e.g. EC2, there is a variety of instances you can pick
[11:25:09] chris412: You're giving me more credit than I deserve :)
[11:25:19] chris412: I'm not sure what you mean by orthogonal here
[11:25:34] huynhlv54: has joined #elixir-lang
[11:27:37] dysfun: what i'm saying is you might not want the compute to happen on all the nodes, you might want compute-oriented nodes
[11:28:14] kyrylo: has joined #elixir-lang
[11:28:43] tnez: has joined #elixir-lang
[11:29:41] k1nd0f: has joined #elixir-lang
[11:33:23] OliverMT: gotta get on those F series nodes on azure broseph
[11:33:39] OliverMT: regards from the azure employee 😂
[11:34:04] OliverMT: what platform are you doing these computes on Chris___?
[11:34:36] OliverMT: if you want to distribute work across a cluster, use an off the shelf product
[11:34:47] OliverMT: even better, go look at databricks if someone is funding this and its not just underfunded hobby work
[11:35:10] OliverMT: databricks is basically distributed computed as a managed service, cloud agnostic and pretty decently priced... small premium on top of compute cost
[11:43:01] kyrylo: has joined #elixir-lang
[12:08:47] chris412: I heard of databricks
[12:09:20] chris412: do you think it could manage the distribution of a python app?
[12:10:23] chris412: I plan to have it keep the data for a single client within one node but to manage the automatic distribution of the vnodes and keep the compute code running local to the data
[12:12:36] OliverMT: databricks is literally "distribution of python apps"
[12:12:43] OliverMT: that is what databricks is, a way to run distributed python
[12:13:01] chris412: Well I'll be damned
[12:13:19] OliverMT: go google, you'll be amazed
[12:13:48] OliverMT: elixir is a great language, but not really a good choice to cobble together this when 99% of data/ai/ml libs already run with native python bindings
[12:13:51] chris412: I've been once
[12:14:05] chris412: yes, I agree
[12:15:08] chris412: What can you say about data partitioning?
[12:15:26] OliverMT: I'm not a databricks specializt, I'm a cloud architect so I don't know the inner workings
[12:15:42] kyrylo: has joined #elixir-lang
[12:15:49] OliverMT: but in general terms, data segmentation is a storage concern, not a compute concern
[12:15:55] chris412: For timeseries data, I may have thousands of sensors streaming data and I want to keep the sensors for a client on the same node
[12:16:24] OliverMT: you'd pre-segment on ingestion for multi tenancy if you want it to be very clean
[12:16:49] OliverMT: but for node affinity I am not sure, ask a databricks expert :)
[12:17:03] OliverMT: normally this would come in via something like azure iot hub, and you'd segment there
[12:17:09] chris412: I want to confirm I understand the third last comment
[12:17:09] OliverMT: and just spin up the compute based on the segmented data
[12:17:44] OliverMT: but, this all depends on your budget, I work with enterprise clients only, their budgets normally start at six figures
[12:17:54] chris412: can I segment based on client ID or do you mean time slice. As in 24 months on one node and the 24 months before that on another node
[12:18:09] duaneb: has joined #elixir-lang
[12:18:22] OliverMT: you can segment on whatever, it also depends where you do it, as I said, gut feeling says segment before you even start your compute
[12:18:24] chris412: That may be another databricks expert question
[12:18:25] nickjj: has joined #elixir-lang
[12:18:29] OliverMT: unless you want the compute and the ingress of data to be the same thing
[12:18:43] OliverMT: it sounds strange to have ingress and compute be the same concern
[12:18:57] chris412: no that wont be the case
[12:21:09] chris412: Can I ask, OliverMT, what would you recommend someone do with Elixir in a commercial setting?
[12:21:12] Sgeo_: has joined #elixir-lang
[12:21:32] OliverMT: anything that isnt more or less pure compute
[12:21:41] OliverMT: elixir would be a great candidate to handle the ingress to some sort of storage here
[12:21:52] OliverMT: then just spin up your data stuff in python as needed
[12:22:10] OliverMT: assuming post process / analytics is the goal and not streaming analytics (although something like databricks also does that)
[12:22:58] gvaughn: has joined #elixir-lang
[12:30:23] asabil: has joined #elixir-lang
[12:31:37] craigp: has joined #elixir-lang
[12:32:20] chris412: I was thinking recurring batch processing. Analysing the most recent data every few hours
[12:32:51] PragTob: has joined #elixir-lang
[12:34:22] kyrylo: has joined #elixir-lang
[12:40:05] OliverMT: that is databricks for you :)
[12:43:13] Cthalupa: has joined #elixir-lang
[12:45:07] drincruz: has joined #elixir-lang
[12:59:14] either|or: has joined #elixir-lang
[13:05:38] __charly__: has joined #elixir-lang
[13:11:04] __charly__: has joined #elixir-lang
[13:15:28] kyrylo: has joined #elixir-lang
[13:22:18] Sentreen: Chris___: if you do decide to go the elixir way, erlport (erlport.org/) makes it ridiculously easy to call python code from elixir.
[13:22:46] Sentreen: So you could easily use elixir to distribute data over various nodes, while calling the required python functionality when needed.
[13:23:06] Sentreen: Of course, as Oliver said, stick to an off the shelf product if there is one :)
[13:32:41] gvaughn: has joined #elixir-lang
[13:37:11] asabil: has joined #elixir-lang
[13:44:39] paxis: has joined #elixir-lang
[13:45:23] schakkis: has joined #elixir-lang
[13:50:00] gffranco: has joined #elixir-lang
[13:51:35] Uniaika: has joined #elixir-lang
[13:52:38] Uniaika: ericmj: hi! I was wondering if it was attested in any way that postgrex was compatible with cockroachdb :)
[13:54:22] dysfun: cockroachdb attest that they speak compliant postgres protocol
[13:58:09] Siyfion: has joined #elixir-lang
[13:59:35] Uniaika: and then there was https://github.com/cockroachdb/cockroach/issues/5582
[13:59:56] Uniaika: that was in 2016
[14:00:22] Uniaika: I used Selda in haskell, that uses libpq, and I've had weird errors about non-existent tables
[14:03:42] work_: has joined #elixir-lang
[14:08:29] gvaughn: has joined #elixir-lang
[14:08:54] Uniaika: Interestingly, there's this fork that appears to be used (at least on projects I found on GH): https://github.com/jumpn/postgrex
[14:09:13] Uniaika: but it's 140 commits behind upstream
[14:19:02] davidw: has joined #elixir-lang
[14:20:20] wsieroci: has joined #elixir-lang
[14:23:37] ariedler: has joined #elixir-lang
[14:23:41] jeffro: has joined #elixir-lang
[14:35:46] asabil: has joined #elixir-lang
[14:46:34] asabil: has joined #elixir-lang
[14:48:00] ariedler: has joined #elixir-lang
[14:49:34] kyrylo: has joined #elixir-lang
[14:59:27] lackac: Uniaika: the maintainers were quite active last year, and I believe it is used in production
[15:00:44] kyrylo: has joined #elixir-lang
[15:04:59] lackac: Uniaika: you might also find this useful if you're planning to use it with Ecto (alas only 2.x): https://gist.github.com/cohawk/df29c1c54abd858dd19d8327e862822a
[15:06:14] Uniaika: yeah I saw this gist a few days ago
[15:06:39] Uniaika: but eh, I was hoping to use Ecto 3
[15:06:56] Uniaika: perhaps my time with Cockroach hasn't come yet
[15:11:15] nox: I'm offended that something between my browser, IRCCloud, and the embedded gist feature decided to word-break `mix ecto.create`.
[15:12:23] mdbm: has joined #elixir-lang
[15:15:22] CornishPasty: I blame IRCCloud
[15:15:48] jeffro_: has joined #elixir-lang
[15:17:10] nox: CornishPasty: Wrong, the embedded gist is an iframe, so it can't be IRCCloud. :)
[15:20:14] asabil: has joined #elixir-lang
[15:21:13] ariedler: I wish there was like a cs carreers channel for random dumb job/interviewing/career questions lol
[15:33:28] mrus: is there another good approach to store a state in a genserver besides of the state parameter / return? I have this scenario in which I think the regular state param/return way won't work.
[15:35:34] mrus: or, let's put it differently: Is there a way to make handle_info receive one message at a time, wait for it to complete processing that message and only then receive the next one?
[15:35:43] mrus: (e.g. a FIFO queue)
[15:36:06] wsieroci: has joined #elixir-lang
[15:41:36] ariedler: mrus: isn't handle_info always receiving one message at a time ...
[15:45:04] mrus: ariedler: not sure, that's why I'm asking. It looks to me like handle_info is being fired for every message but is not being waited for to finish, before firing handle_info for another message.
[15:47:09] samgaw: has joined #elixir-lang
[15:49:06] mrus: I observed that, when I received a handle_info message triggered by an interrupt, processing began while in the meantime another interrupt triggered yet another handle_info execution, which also started but with the same state the previous handle_info received. It looked like the first handle_info did not finish and write back its new state, so the second handle_info could use that state.
[15:50:17] mrus: so basically it looked like I had two handle_info running with the same state, rather than handle_info (1) with the original state and handle_info (2) with the state updated by handle_info (1).
[15:51:34] mrus: but maybe it was something else within the code that led to this behaviour. Just wanted to know how handle_info is supposed to work.
[15:52:30] samgaw: Has anyone come up against using DB generated IDs with embedded_schemas? Normally I'm setting `@primary_key {:id, :string, autogenerate: false, read_after_writes: true}` in a normal schema (thanks to advice from Jose) and then including `default: fragment("custom_id()")` in my migrations. But I'm not entirely sure how to go about this with embedded_schemas, specifically setting the default with a fragment. Any advice
[15:52:30] samgaw: or general direction is very much appreciated.
[15:55:12] samgaw: Crap. I've just seen https://github.com/elixir-ecto/ecto/issues/2634"It is for those reasons why we do not allow defaults for embeds and relationships"
[15:55:21] nineczar: has joined #elixir-lang
[15:57:26] Beam`: has joined #elixir-lang
[15:58:35] DarkSeid: has joined #elixir-lang
[16:09:27] drincruz: has joined #elixir-lang
[16:10:22] torwegia: has joined #elixir-lang
[16:12:57] wsieroci: has joined #elixir-lang
[16:34:20] edw: I'm going through the Gigalixir tutorial screencast and after adding a blog object to the sample Phoenix app's schema I added `<%= link "Blog", to: post_path(@conn, :index) %>` to the template, and mix is complaining that post_path/2 is not found. If I replace `post_path(...)` with `TeacherWeb.Router.Helpers.post_path(...)` all is well. The magic is killing me here. Could someone provide some insight into Phoenix?
[16:34:46] edw: The screencast is here, FWIW: https://gigalixir.readthedocs.io/en/latest/main.html
[16:35:17] samgaw: @edw Phoenix 1.4 changed to be more explicit. Do `Routes.post_path` and it should work for you.
[16:35:26] edw: Ah. Thank you.
[16:36:27] edw: Is there a commonly used … umm, less magical … framework for building HTTP-based apps?
[16:36:42] dysfun: edw: re: the magic, the "magic" is that your view templates get compiled into your view module
[16:36:48] edw: Phoenix seems highly Railsy.
[16:36:55] dysfun: so they are evaluated in the context of your view module
[16:37:17] dysfun: which will start off with use Myapp :view or somesuch
[16:38:01] dysfun: yes, phoenix is inspired by rails and aims to target a similar level of integrated solution
[16:38:03] edw: OK. The synthesizing of fns and such, it's overwhelming.
[16:38:10] rawtaz: EHLO rawtaz
[16:38:32] dysfun: i agree. i don't like the phoenix view layer
[16:38:34] Nicd-: edw: there is Raxx, but it's a lot more minimal. I'll leave you to decide how magical it feels: https://gitlab.com/Nicd/mebe-2/tree/master/lib/web
[16:38:37] dysfun: i nonetheless use phoenix
[16:38:47] Nicd-: (that is my blog)
[16:38:48] rawtaz: dysfun: what do you not like about it?
[16:39:09] dysfun: i spend too much time getting things wrong with it
[16:39:43] edw: Thanks, Nicd-. I'll check it out.
[16:40:02] dysfun: when he says "it's a lot more minimal", he really means it
[16:40:45] rawtaz: tried LiveView yet? :)
[16:40:50] dysfun: you can use raw Plug directly
[16:40:54] edw: I'm accustomed to things like Ring + Compojure or Flask.
[16:40:56] dysfun: no, i haven't yet
[16:41:02] dysfun: oh, clojure, heh
[16:41:15] Nicd-: yeah Plug is similarly minimal
[16:41:16] dysfun: well, you might prefer plug then
[16:41:23] edw: Or Flask, or Flask!
[16:41:32] Nicd-: and Raxx has nothing like Phoenix Channels (it has HTTP/2 support though)
[16:42:21] edw: Cool. I will check out Plug. Even if I use Phoenix eventually, I'd like to understand what's going between me and HTTP requests and responses.
[16:42:46] Nicd-: Phoenix is built on Plug so learning Plug is useful
[16:42:48] dysfun: i like the idea of not using phoenix, but on the whole it's too convenient
[16:45:48] edw: dysfun: Using a library-based approach versus a framework-based approach to building things doesn't mean giving up convenience; it just means that you're not stuck doing Madlibs-style fill-in-the-blanks programming.
[16:46:25] dysfun: yes yes, i was a clojure developer for 5 years
[16:47:56] samgaw: Spend enough time building a web app with Plug etc and you'll end up building your own unsupported Phoenix. It's an opinionated set of libs & helpers that happen to be very well thought out to the point that it feels like magic or that it's too easy & that you're missing something.
[16:48:27] dysfun: that's not quite how i'd put it, but it's true that you'll need a certain amount of glue to avoid phoenix
[16:49:54] edw: samgaw: I agree, assuming you're building things that Phoenix is designed to build.
[16:50:31] edw: Most of my work is very light on the CRUD.
[16:52:15] dysfun: if you can arrange to do all your work over phoenix channels, things will be very easy for you
[16:52:42] edw: dysfun: Under which scenario?
[16:53:05] dysfun: well it's a lot less effort than handling a new http request
[17:06:45] asabil: has joined #elixir-lang
[17:15:19] Jetimon: has joined #elixir-lang
[17:16:17] lexmag: has joined #elixir-lang
[17:19:18] asabil: has joined #elixir-lang
[17:24:50] orbyt_: has joined #elixir-lang
[17:29:19] asabil: has joined #elixir-lang
[17:42:42] pera: has joined #elixir-lang
[17:43:17] jeffro_: has joined #elixir-lang
[17:58:37] jeffro_: has joined #elixir-lang
[18:02:29] aalmazan: has joined #elixir-lang
[18:04:50] wsieroci: has joined #elixir-lang
[18:06:30] wonko7: has joined #elixir-lang
[18:15:32] jeffro_: has joined #elixir-lang
[18:15:48] syndikate: Hey, I am trying to define a guard like this but am getting syntax error. Although am not able to figure what I am missing here.
[18:16:14] syndikate: defguard valid_position({x, y}) when is_integer(x) and is_integer(y)
[18:16:14] syndikate: defguard valid_position({x, y}) when is_integer(x) and is_integer(y)
[18:16:21] syndikate: Sorry, double paste
[18:22:57] orbyt_: has joined #elixir-lang
[18:38:49] k1nd0f: has joined #elixir-lang
[18:48:35] Nicd-: what error are you getting?
[18:48:51] Nicd-: can you gist the whole file?
[18:53:28] kyrylo: has joined #elixir-lang
[18:54:39] orbyt_: has joined #elixir-lang
[18:56:45] pera: has joined #elixir-lang
[19:03:33] orbyt_: has joined #elixir-lang
[19:10:59] ejpcmac: has joined #elixir-lang
[19:13:02] ejpcmac: has joined #elixir-lang
[19:22:00] proteusguy: has joined #elixir-lang
[19:33:17] wsieroci: has joined #elixir-lang
[19:33:39] syndikate: Nicd- https://hastebin.com/ojowutajeh.coffeescript
[19:33:47] syndikate: Not the full file but the error
[19:33:57] benwilson512: syndikate: I don't think you can do pattern matches in defguard
[19:34:31] benwilson512: you could do defguard valid_position(tuple) when is_integer(elem(tuple, 0)) and is_integer(elem(tuple, 1))
[19:35:13] syndikate: Why would that be so?
[19:35:22] syndikate: Is it because of how macro gets expanded?
[19:36:11] benwilson512: syndikate: defguard just lets you compose guards
[19:36:30] benwilson512: from fundamental guard primitives, and no built in guards do pattern matching
[19:47:34] squall: has joined #elixir-lang
[19:50:31] k1nd0f: has joined #elixir-lang
[19:57:37] orbyt_: has joined #elixir-lang
[20:04:11] asabil: has joined #elixir-lang
[20:04:45] shritesh: has joined #elixir-lang
[20:16:13] work_: has joined #elixir-lang
[20:26:50] orbyt_: has joined #elixir-lang
[20:44:15] Gazler: has joined #elixir-lang
[20:46:27] orbyt_: has joined #elixir-lang
[20:50:25] asabil: has joined #elixir-lang
[20:57:22] asabil: has joined #elixir-lang
[21:04:49] asabil: has joined #elixir-lang
[21:07:09] ur5us: has joined #elixir-lang
[21:11:06] OliverMT: benwilson512 update on my web1.0 reusage of big graphl base
[21:11:14] OliverMT: basically, I ended up just using the Schema.run
[21:11:31] OliverMT: easier than wrangling the system
[21:11:54] OliverMT: only thing I need to solve is pushing file uploads through a mutation meant for apollo uploading files
[21:15:39] k1nd0f: has joined #elixir-lang
[21:25:50] __charly__: has joined #elixir-lang
[21:29:38] ejpcmac: has left #elixir-lang: ()
[21:31:36] ejpcmac: has joined #elixir-lang
[21:36:08] asabil: has joined #elixir-lang
[21:43:18] d10n-work: has joined #elixir-lang
[21:47:28] ejpcmac: has left #elixir-lang: ()
[21:53:01] asabil: has joined #elixir-lang
[22:02:09] thomasross: has joined #elixir-lang
[22:08:33] orbyt_: has joined #elixir-lang
[22:20:52] mahmudov: has joined #elixir-lang
[22:26:12] orbyt_: has joined #elixir-lang
[22:43:33] lauromoura_: has joined #elixir-lang
[22:44:03] helmut_1: has joined #elixir-lang
[22:55:10] drincruz: has joined #elixir-lang
[23:11:23] asabil: has joined #elixir-lang
[23:27:58] Sgeo_: has joined #elixir-lang
[23:27:58] teepark: has joined #elixir-lang
[23:27:58] traxo: has joined #elixir-lang
[23:27:58] blahdodo: has joined #elixir-lang
[23:27:58] b6b: has joined #elixir-lang
[23:39:04] netrino: has joined #elixir-lang
[23:39:15] craigp: has joined #elixir-lang