« Back to channel list

#elixir-lang - 25 April 2019

« Back 1 day Forward 1 day »
[00:00:23] kyrylo: has joined #elixir-lang
[00:08:06] icanhazbroccoli: has joined #elixir-lang
[00:27:16] LnL: has joined #elixir-lang
[00:40:46] LnL7: has joined #elixir-lang
[00:58:05] Sgeo: has joined #elixir-lang
[01:04:23] kiltzman: has joined #elixir-lang
[01:06:49] carldd: has joined #elixir-lang
[01:08:05] rbino: has joined #elixir-lang
[01:11:41] orbyt_: has joined #elixir-lang
[01:16:28] orbyt_: has joined #elixir-lang
[01:17:42] Sgeo_: has joined #elixir-lang
[01:20:43] mdbm: has joined #elixir-lang
[01:23:48] Saukk: has joined #elixir-lang
[01:29:43] ariedler: has joined #elixir-lang
[01:41:15] greengriminal: has joined #elixir-lang
[01:48:00] sparogy: has joined #elixir-lang
[01:56:19] bakedb_: has joined #elixir-lang
[01:58:59] tomterl: has joined #elixir-lang
[02:05:00] bakedb: has joined #elixir-lang
[02:05:26] lauromoura__: has joined #elixir-lang
[02:17:32] KJF: has joined #elixir-lang
[02:21:31] KJF: has joined #elixir-lang
[02:23:59] jmcgnh: has joined #elixir-lang
[02:34:11] jeffro: has joined #elixir-lang
[02:45:11] mdbm: has joined #elixir-lang
[03:17:52] mdbm_: has joined #elixir-lang
[03:20:22] carldd: has joined #elixir-lang
[03:21:23] kiltzman: has joined #elixir-lang
[03:27:05] DTZUZO: has joined #elixir-lang
[03:49:55] sparogy: has joined #elixir-lang
[03:53:31] brandfilt: has joined #elixir-lang
[03:56:11] ariedler: has joined #elixir-lang
[04:09:45] Sgeo: has joined #elixir-lang
[04:15:48] notzmv: has joined #elixir-lang
[04:35:11] jeffro: has joined #elixir-lang
[04:40:11] gvaughn: has joined #elixir-lang
[04:40:38] orbyt_: has joined #elixir-lang
[04:51:24] Guest97: has joined #elixir-lang
[05:06:06] kaniini: has joined #elixir-lang
[05:12:59] netrino: has joined #elixir-lang
[05:26:51] kiltzman: has joined #elixir-lang
[05:28:13] voltone: has joined #elixir-lang
[05:29:07] Sgeo_: has joined #elixir-lang
[05:30:42] zergov: has joined #elixir-lang
[05:31:55] zergov_: has joined #elixir-lang
[05:32:37] mdbm: has joined #elixir-lang
[05:48:35] elixir-lang988: has joined #elixir-lang
[05:48:49] elixir-lang988: Hello all. I have a question about dialyzer
[05:49:11] gvaughn: has joined #elixir-lang
[05:50:46] elixir-lang988: I am using a nif library(called :libsecp256k1). I have a wrapper module in Elixir calling some function in :libsecp256k1. There is no type spec for :libsecp256k1. So even though my wrapper function is with spec. Dialyzir keep complaning :libsecp256k1.ecdsa_recover_compact return no_return
[05:51:44] elixir-lang988: and it causes lots of error from this. Is there a ways to tell dialyzer to just respect/trust the spec I written for a function and don't do success typing checking?
[05:52:15] meimeix: has joined #elixir-lang
[05:53:49] Nicd-: can you show the problem code and the warning?
[05:55:32] elixir-lang988: lib/bitcoin/secp256k1.ex:20:no_return Function ecdsa_recover_compact/4 has no local return.
[05:57:04] elixir-lang988: this will bubble up and cause other function calling this to have pattern_match problem
[05:57:30] ariedler: has joined #elixir-lang
[05:58:59] Nicd-: can you show the code?
[06:06:01] proteusguy: has joined #elixir-lang
[06:06:44] elixir-lang910: has joined #elixir-lang
[06:17:06] PragTob: has joined #elixir-lang
[06:17:59] mbuf: has joined #elixir-lang
[06:20:46] sparogy: has joined #elixir-lang
[06:22:42] proteusguy: has joined #elixir-lang
[06:23:40] brandfilt: has joined #elixir-lang
[06:36:07] jeffro: has joined #elixir-lang
[06:38:05] squall: has joined #elixir-lang
[06:57:45] netrino: has joined #elixir-lang
[07:00:19] voltone: has joined #elixir-lang
[07:18:01] Guest97: has joined #elixir-lang
[07:20:16] Guest97: has joined #elixir-lang
[07:42:14] gvaughn: has joined #elixir-lang
[07:57:15] mikker: has joined #elixir-lang
[07:58:24] ariedler: has joined #elixir-lang
[08:00:27] 5EXAAMJSR: has joined #elixir-lang
[08:01:47] voltone: has joined #elixir-lang
[08:22:13] LnL7: has joined #elixir-lang
[08:37:00] jeffro: has joined #elixir-lang
[08:38:54] m1dnight1: Huzzah, there was finally a meetup in Belgium last week :D
[08:44:31] mdbm: has joined #elixir-lang
[08:45:33] lexmag: has joined #elixir-lang
[08:50:12] sparogy: has joined #elixir-lang
[08:51:09] wonko7: has joined #elixir-lang
[08:53:57] brandfilt: has joined #elixir-lang
[08:54:33] gvaughn: has joined #elixir-lang
[09:01:59] lpil: Sweet. How was it?
[09:05:08] carb0n: has joined #elixir-lang
[09:19:07] Sgeo_: has joined #elixir-lang
[09:23:06] lexmag: has joined #elixir-lang
[09:25:03] tnez: has joined #elixir-lang
[09:30:14] jimmyrcom: has joined #elixir-lang
[09:52:31] lexmag: has joined #elixir-lang
[09:59:08] ariedler: has joined #elixir-lang
[10:00:53] lexmag: has joined #elixir-lang
[10:05:53] carb0n: has joined #elixir-lang
[10:08:16] elixir-lang917: has joined #elixir-lang
[10:37:46] jeffro: has joined #elixir-lang
[10:40:53] elixir-lang963: has joined #elixir-lang
[10:41:39] elixir-lang963: sorry guys. I have noob question. Is there a way to read chat history here? I asked a question here few hours before but then I had to leave
[10:42:48] Nicd-: there is no log right now
[10:43:04] Nicd-: this was the last line that was said to you:
[10:43:06] Nicd-: 08:58:33 <Nicd-> can you show the code?
[10:47:44] zigpaw: has joined #elixir-lang
[10:48:40] elixir-lang963: https://gist.github.com/bruteforcecat/3620df8fdb823f38b4486ee9429dccd3
[10:49:11] elixir-lang963: libsecp256k1 is a nif library without spec written. So diayzer was complaing about the wrapper function `ecdsa_recover_compact` no_return doesnt match the typespec
[10:49:19] elixir-lang963: and this causes a lot of problems as this error is propagate to other function that calling `ecdsa_recover_compact`. Add `lib/bitcoin/secp256k1.ex` to dialyzer_ignore only silent the no_return in this file but it still cause the other function calling it having error
[10:49:33] elixir-lang963: How can I force dialyzer to just "respect/trust" a type spec for a function and do not do checking for that specific function
[10:51:05] CornishPasty: elixir-lang963: the NIF should have an erlang definition where it returns nif_error
[10:52:07] elixir-lang963: https://github.com/mbrix/libsecp256k1/blob/master/src/libsecp256k1.erl#L94
[10:52:47] elixir-lang963: this is the nif fucntion. I because it's because no spec is written for the function there? Is there a way to fix this/work around apart from forking it and adding spec to it?
[10:53:04] CornishPasty: Yeah that's not a good nif
[10:54:09] elixir-lang963: haaa. wonder if there is a work around of it?
[10:54:21] CornishPasty: The nif should be returning http://erlang.org/doc/man/erlang.html#nif_error-1
[10:54:44] CornishPasty: That shouldn't be an error though, just a dialyser warning right?
[10:55:09] ariedler: has joined #elixir-lang
[10:56:20] elixir-lang963: it looks like an error "Function ecdsa_recover_compact/4 has no local return."
[10:57:07] Sgeo_: has joined #elixir-lang
[10:57:10] CornishPasty: Are you using dialyxir?
[10:57:45] CornishPasty: You could use this: https://github.com/jeremyjh/dialyxir#ignore-warnings
[10:58:14] CornishPasty: Also see https://github.com/jeremyjh/dialyxir#elixir-term-format
[11:04:29] elixir-lang963: thank you. But this is the only way. because that cause multiple other function call having error.
[11:04:36] elixir-lang963: thank you. But this is the only way?. because that cause multiple other function call having error.
[11:05:33] elixir-lang963: There is no way to "override" typespec for other library?
[11:19:22] proteusguy: has joined #elixir-lang
[11:20:00] sparogy: has joined #elixir-lang
[11:21:39] gvaughn: has joined #elixir-lang
[11:24:09] brandfilt: has joined #elixir-lang
[11:29:38] kyrylo: has joined #elixir-lang
[11:31:54] Cthalupa: has joined #elixir-lang
[11:46:56] bakedb: has joined #elixir-lang
[11:49:53] codewaffle: has joined #elixir-lang
[11:53:21] Soni: has joined #elixir-lang
[12:12:49] verto: has joined #elixir-lang
[12:13:31] voltone: has joined #elixir-lang
[12:18:22] verto: has joined #elixir-lang
[12:31:46] tomterl: has joined #elixir-lang
[12:31:58] m1dnight_: has joined #elixir-lang
[12:38:37] jeffro: has joined #elixir-lang
[12:53:50] either|or: has joined #elixir-lang
[12:53:57] verto: has joined #elixir-lang
[13:00:30] duaneb: has joined #elixir-lang
[13:00:49] sparogy: has joined #elixir-lang
[13:06:16] lauromoura__: has joined #elixir-lang
[13:08:06] lexmag: has joined #elixir-lang
[13:16:11] gvaughn: has joined #elixir-lang
[13:24:37] rambocoder: has joined #elixir-lang
[13:32:20] duaneb: has joined #elixir-lang
[13:54:26] brandfilt: has joined #elixir-lang
[13:57:47] hypercore: has joined #elixir-lang
[13:58:02] hypercore: how can i have a default value of nil for a boolean in my schema?
[13:58:27] ericmj: I think that's exactly what you get by default
[13:58:49] hypercore: ericmj: it's causing an error for some reason, only works if i set default: false/true in my schema
[13:59:19] ericmj: can you show the error?
[14:02:37] hypercore: ericmj: trying to get it back, phoenix isn't throwing it anymore (form just redirectrs to "new.html")
[14:03:17] wsieroci: has joined #elixir-lang
[14:04:23] hypercore: ericmj: got it
[14:05:21] hypercore: -> "lists in Phoenix.HTML and templates may only contain integers representing bytes, binaries or other lists, got invalid entry: #Ecto.Changeset<action: :update, changes: %{}, errors: [], data: #MyApp.Products.Tag<>, valid?: true>"
[14:05:52] hypercore: happens in my form at <%= hidden_input, :tags %>
[14:06:13] ericmj: does that error go away if you add `default: false` to your schema field?
[14:06:23] hypercore: was about to say exactly that, yep
[14:06:57] ericmj: that's strange because the error looks unrelated and :tags doesn't seem to be a boolean field?
[14:07:50] hypercore: ericmj: it shouldn't matter if i don't have that boolean field in my form right?
[14:08:03] hypercore: (because i set it using default: (true,false,nil)
[14:08:08] hypercore: (in my schema)
[14:08:19] ericmj: I don't know because I don't understand the error
[14:08:23] gvaughn: has joined #elixir-lang
[14:15:52] hypercore: yeah me neither lol
[14:16:15] ericmj: since the error looks unrelated it may be that you have some application code that depends on the default value
[14:16:21] ericmj: which causes the unrelated error
[14:19:31] hypercore: ericmj: just to make sure, this code in my migration should be fine i assume? "add :payed, :boolean, null: true"
[14:20:00] ericmj: you don't need `null: true`, it's the default
[14:20:46] ankhers: hypercore: You may want `:paid` instead of `:payed`.
[14:24:57] hypercore: apparently :paid was a required field, but phoenix wasn't displaying the error in the form/changeset
[14:25:18] hypercore: all good now, thanks guys
[14:25:39] hypercore: Ankhers: is there a difference between paid and payed?
[14:26:31] ankhers: Assuming you are talking about financial stuff, paid is the proper past tense form of pay.
[14:26:35] voltone: has joined #elixir-lang
[14:27:13] hypercore: good to know, thanks
[14:38:27] chrismcg: has joined #elixir-lang
[14:59:53] BitBot: has joined #elixir-lang
[15:11:24] voltone: has joined #elixir-lang
[15:25:39] proteusguy: has joined #elixir-lang
[15:40:36] orbyt_: has joined #elixir-lang
[15:57:57] schainks: has joined #elixir-lang
[16:10:21] mdbm: I'm learning about spawning process and I do not understand why this code sometimes prints "hello"
[16:10:21] mdbm: https://pastebin.com/raw/8QDbyqPb
[16:10:32] mdbm: why doesn't spawn_monitor always catch the failure?
[16:17:27] Nicd-: timing issue?
[16:22:14] ariedler: mdbm: are you confused why gone sometimes happens first? or ...
[16:23:11] pera: has joined #elixir-lang
[16:24:37] brandfilt: has joined #elixir-lang
[16:25:20] mdbm: ariedler, dude I don't know what I'm doing
[16:25:22] mdbm: https://pastebin.com/raw/0YhQQUDY
[16:25:29] mdbm: this prints like 30+ times "hello"
[16:25:40] mdbm: but I send 4 messages
[16:25:48] jeffro: has joined #elixir-lang
[16:26:37] mdbm: hah, and now when I execute again, I receive 4 messages
[16:26:57] mdbm: the first execution of the function returned me a lot of "hello" messages for some reason
[16:27:12] assemblyman: has joined #elixir-lang
[16:27:44] ariedler: mdbm: you probably had a bunch of old messages in your queue
[16:28:02] ariedler: cause I noticed the first time, you were reading 1 of the two messages in your mailbox
[16:28:30] ariedler: so you had a bunch of extra messages in your mailbox from previous Spawn.run instances
[16:28:41] mdbm: ariedler, but why sometimes I had :DOWN first? (when I get only one message, first snippet)
[16:28:56] ariedler: the first snippet is your getting the DOWN from the previous instance of Spawn.run
[16:28:57] mdbm: I got it
[16:29:09] mdbm: there's some kind of queue
[16:31:38] ariedler: yes, its ordered between two processes
[16:33:38] Sgeo_: has joined #elixir-lang
[16:37:47] mdbm_: has joined #elixir-lang
[16:39:30] benwilson512: mdbm_: if you're running this in iex, make sure to call flush() after each run
[16:39:36] benwilson512: so that your inbox is cleared
[16:39:56] mdbm_: benwilson512, good to know, thank you!:)
[16:40:01] benwilson512: alternatively you can also respawn() which will start iex as a whole new process. this is handy if there are timers still active waiting to send messages to the original iex process
[16:40:19] benwilson512: flush() will only clear active messages, it can't clear messages that arrive after you call flush() due to timers you had running
[16:40:32] starbelly: benwilson512: Curious, why does ex_aws still use Poison? open to a PR to change it to Jason?
[16:42:18] mdbm_: benwilson512, self() prints "#PID<0.478.0>" then I type respawn(), execute self() again, and still prints the same PID number "#PID<0.478.0>"
[16:45:05] gamache: Just because Jason exists doesn't mean Poison stopped working :D
[16:46:49] Nicd-: yeah I don't see a reason to change as long as it lets you configure the JSON encoder you want
[16:48:33] gamache: then again, Jason ships with a JSON pretty-printer of unsurpassed elegance and shibumi
[16:50:54] micmus: gamache: poison 4 stopped working with phoenix & ecto, because it broke the API they used. So using poison in a project with phoenix or ecto you're bound to use old versions only
[16:51:21] gamache: huh, I did not know that
[16:54:54] jeffro: has joined #elixir-lang
[16:56:26] jeffro_: has joined #elixir-lang
[16:58:05] warmwaffles: has joined #elixir-lang
[16:58:52] brandfilt: has joined #elixir-lang
[17:00:11] starbelly: The performance gains alone are a big reason to change it IMO
[17:00:36] mahmudov: has joined #elixir-lang
[17:00:42] starbelly: If that's not good enough, I just removed 10 dialyzer warnings from an ignore file because the app just got rid of Poison
[17:02:45] mdbm_: is there any reason to call exit() here?
[17:02:47] mdbm_: https://pastebin.com/raw/bpJU4SQb
[17:02:52] wonko7: has joined #elixir-lang
[17:03:22] benwilson512: starbelly: PR welcome, although it's always been pluggable
[17:03:32] starbelly: ACTION did not know
[17:03:39] benwilson512: poison is an optional dependency, ExAws has never had it as a requirement
[17:03:44] mdbm__: has joined #elixir-lang
[17:03:47] mdbm__: (just got d/c)
[17:03:57] starbelly: It's being pulled in as a transitive dep, but yeah I'll look at the optional bit
[17:04:17] benwilson512: starbelly: not by ExAws it isn't
[17:04:31] benwilson512: it will be if you're developing ExAws
[17:04:37] benwilson512: but not if you're using ExAws as a dependency
[17:04:42] benwilson512: mdbm__: not really any point to the exit
[17:04:56] starbelly: Yeah, I'm full of caffeine, I'll wait for that to taper off, then have another look
[17:05:47] mdbm__: benwilson512, and when I want to do nothing, is it good to return nil? def some_function(), do: nil
[17:06:24] benwilson512: starbelly: ah wait sorry, are you spawning `fib` as a process?
[17:07:35] benwilson512: exit normal is probably good there, didn't read it in context, my bad. FYI You could just match on :shutdown
[17:07:38] benwilson512: no point in wrapping it in a tupel
[17:07:47] brandfilt: has joined #elixir-lang
[17:07:56] mdbm__: benwilson512, alright, it's from a book
[17:16:19] pera: has joined #elixir-lang
[17:16:53] lexmag: has joined #elixir-lang
[17:18:42] mdbm__: good night guys, thanks for help!
[17:24:47] lexmag: has joined #elixir-lang
[17:53:22] chrismcg: has joined #elixir-lang
[18:34:22] chrismcg: has joined #elixir-lang
[18:40:55] aither64: has joined #elixir-lang
[18:43:35] chrismcg: has joined #elixir-lang
[18:56:27] dkmueller: has joined #elixir-lang
[18:59:36] Sgeo_: has joined #elixir-lang
[19:01:14] jeffro_: has joined #elixir-lang
[19:02:28] aalmazan: has joined #elixir-lang
[19:22:50] greengriminal: has joined #elixir-lang
[19:27:56] laut: has joined #elixir-lang
[19:30:38] Phylock: has joined #elixir-lang
[19:34:44] work_: has joined #elixir-lang
[21:06:14] netrino: has joined #elixir-lang
[21:12:50] Sentreen: has joined #elixir-lang
[21:13:47] netrino: has joined #elixir-lang
[21:17:20] jeffro_: has joined #elixir-lang
[21:19:03] Phylock: has joined #elixir-lang
[21:28:14] DTZUZO: has joined #elixir-lang
[22:02:57] sparogy: has joined #elixir-lang
[22:06:43] squall: has joined #elixir-lang
[23:08:46] zigpaw: has joined #elixir-lang
[23:12:05] lauromoura_: has joined #elixir-lang
[23:24:05] craigp: has joined #elixir-lang
[23:39:10] Sgeo__: has joined #elixir-lang
[23:43:29] lexmag_: has joined #elixir-lang
[23:55:11] craigp: has joined #elixir-lang
[23:59:02] orbyt_: has joined #elixir-lang