<    April 2017    >
Su Mo Tu We Th Fr Sa  
                   1  
 2  3  4  5  6  7  8  
 9 10 11 12 13 14 15  
16 17 18 19 20 21 22  
23 24 25 26 27 28 29  
30
00:00 dustinfarris joined
00:00 noeljackson joined
00:12 <Radar> I have some supervisors setup in my application which are responsible for starting processes that fetch events. These events are typically noisy. How can I make it so that during the tests these supervisors are not started automatically?
00:15 <Radar> This is how I'm doing it currently: https://gist.github.com/radar/c4e281ead38d54e289650de72d769bf3
00:16 chrismccord joined
00:18 icecreamcohen joined
00:28 griffinbyatt joined
00:29 <mk[]> Radar: excluding them from the children list doesn't work?
00:35 codestorm joined
00:36 mwbrown joined
00:37 jhack joined
00:40 griffinbyatt joined
00:40 wpcarro joined
00:40 Machete joined
00:41 sfbw joined
00:41 harfangk joined
00:43 whharris joined
00:46 steffkes joined
00:46 steffkes joined
00:49 <Radar> mk[]: well, it works. I just don't know if this is considered "best practice" or not.
00:52 <Ankhers> Radar: What do you mean by noisy?
00:53 <Radar> Ankhers: The events generate a bunch of SQL statements (debug logging is turned on, could be turned off) and there's some other logging. I'm also trying to prevent them from modifying the database when I'm running IEx.
00:54 sevenseacat joined
00:55 nighty-- joined
00:58 <Ankhers> Radar: You could do what the mongodb driver does. https://github.com/ericmj/mongodb/blob/master/test/test_helper.exs#L45-L49
00:58 <Ankhers> Not sure if it is going to be viable for what you are doing though.
00:58 <Radar> Ankhers: thank you.
01:00 <mk[]> is there any reason to choose an SQL DB over a combination of Mnesia and Riak?
01:01 <Ankhers> I'm going to go with, more people probably know and understand SQL than Mnesia and Riak. That may not matter if your usecase though.
01:04 <mk[]> learning inertia is the only argument I've heard so far
01:04 <mk[]> I wonder if there are any technical reasons
01:05 Cohedrin joined
01:05 <Ankhers> I think it largely depends on your application needs.
01:06 <Ankhers> It is like asking if Postgres or Mongo is the better database. Without knowing your needs, it is impossible to say.
01:06 <sorentwo> Most applications don't need(want) to start out with a cluster of 3 databases, which is the minimum for a production Riak setup IIRC.
01:07 <mk[]> sorentwo: I thought riak works with one node. why wouldn't it?
01:08 <mk[]> Ankhers: if the DB needs to be distributed, SQL has clear disadvantages, right?
01:09 <sorentwo> Riak is geared toward fault tolerance and clustering, for the cluster to work you need three instances.
01:09 <sorentwo> I'm sure it works with one node, but you lose most of the point of running Riak.
01:10 <Ankhers> I just read something from 2012 saying they suggest a minimum of 5 nodes for production.
01:10 <Ankhers> Not sure if that is still the case.
01:10 <sorentwo> Ankhers: Even better, that shows why there is so much resistance to starting new projects with Riak.
01:11 <Ankhers> As for distributed SQL, most applications won't need something like that. And if they do, I'm going to be honest, I don't know much about distributed SQL.
01:12 <mk[]> Ankhers: neither do I, but I thought the whole reason for the myriad of NoSQL DBs was SQL's inadequate distribution ability
01:13 <mk[]> sorentwo: clustering adds complexity, but it's a necessary evil
01:13 <sorentwo> mk[]: Perhaps for the companies/apps you're working with, but it hasn't been in most of my experiences.
01:13 <Ankhers> I'm not a huge database person, but I don't think there is anything inherint in SQL that prevents it from being distributed.
01:14 <sorentwo> I'm not against clustering btw, I was using that as an example of where non-sql tools get increased friction.
01:14 <arpunk> mk[]: If you need distributed SQL: https://github.com/cockroachdb/cockroach
01:14 <sorentwo> There are companies like citus that offer a good distributed postgres solution as well.
01:15 <tristan__> postgres has more features and can do complex queries. mnesia can be a pain in the ass. riak is a key/value store
01:17 wpcarro joined
01:17 <mk[]> tristan__: why can mnesia be a pain in the ass?
01:19 <tristan__> the whole schemas thing can get messed up and confusing. and that is when dealing with just 1 node. the default backend is also highly limited. but now you can use leveldb, but still have to deal with schemas and want to stay away from using it distributed
01:20 <mk[]> that sucks. ETS works well enough as a distributed RAM cache?
01:21 <tristan__> hm? it isn't distributed
01:21 <mk[]> oh
01:22 <Ankhers> You could build one on top of ETS.
01:23 <mk[]> isn't it what Mnesia supposed to be good for?
01:24 <Ankhers> You have to deal with split-brain yourself with Mnesia, don't you?
01:24 <mk[]> never used it, doing research
01:27 wpcarro joined
01:28 <tristan__> not really. it can work for distributed use cases, but not ones with heavy load or running in like the cloud
01:29 codestorm joined
01:32 <mk[]> tristan__: what about couchbase?
01:33 kronicdeth joined
01:35 <mk[]> I was turned off by the fact that couchbase has no official erlang client, though it's written (partly) in Erlang
01:36 <Ankhers> https://gist.github.com/ankhers/27c6fee6f4773eaf96b44de4e05e3180 -- Does anyone know if this is supposed to be valid Elixir? It just returns nil if it is supposed to go into the error branch.
01:38 <asonge> hrm, didn't know that the body of a clause could be empty
01:38 <asonge> but if it can, and it's not a parser error, nil would be expected.
01:39 tomterl joined
01:42 sfbw joined
01:42 wpcarro joined
01:43 jhack joined
01:43 cschneid_ joined
01:43 jhack joined
01:43 <Ankhers> It does return nil. And only the last body can be empty.
01:43 <Ankhers> I'm just wondering if that is expected behaviour, or if I should file a bug.
01:45 mika__ joined
01:48 <asonge> i'd ping back. it might be either a parser or compiler bug of some kind, but who knows. i'm leaning bug. can always file a ticket as well.
01:59 jkreeftmeijer joined
02:01 Machete joined
02:10 whharris joined
02:10 wpcarro joined
02:12 sfaxon__ joined
02:17 jerel joined
02:19 <laut> Is anyone here using a script or similar for detecting Elixir warnings? For instance for detecting code in pull requests that triggers Elixir warnings.
02:20 nomicflux joined
02:20 wpcarro joined
02:23 Cohedri__ joined
02:23 codestorm joined
02:25 Machete joined
02:34 <asonge> laut: i wrote a few regular expressions for lifting warnings and errors into vscode problems area, i can dig them up.
02:34 Cohedrin joined
02:34 <asonge> laut: you could piece stuff together from what i've got here: https://asonge.github.io/2017/04/05/support-vscode-problems-with-mix-tasks/
02:35 <asonge> multiple patterns allow you to match multiple lines down, so if you need a single expression over a blob of text, it'll need some slight tweaking
02:36 Machete joined
02:36 <asonge> build and test are the ones you want to look at, dialyzer warnings are a bit more basic.
02:37 NeverDie_ joined
02:38 <laut> asonge: cheers. I don't use vscode, but interesting to see
02:44 sfbw joined
02:47 steffkes joined
02:47 steffkes joined
02:49 mika__ joined
02:49 Cohedrin joined
02:52 codestorm joined
02:53 sfbw joined
03:00 jkreeftmeijer joined
03:05 lsiqueira joined
03:08 lsiqueira left
03:17 wpcarro joined
03:30 nomicflux joined
03:33 skace joined
03:34 jerel joined
03:51 wpcarro joined
03:54 sfbw joined
04:01 <iFire> sorentwo: hey
04:01 <iFire> are you still around?
04:02 <iFire> mk[]: hey
04:02 wpcarro joined
04:02 Cohedrin joined
04:02 <mk[]> iFire: yeah
04:02 <iFire> so I've been trying to write an elixir driver for snappydata
04:02 <iFire> it's a cluster sql database
04:03 wwwd joined
04:03 <iFire> it's faster than cockroachdb
04:03 <iFire> but cockroachdb has a easier deploy
04:03 <iFire> and ... cockroachdb is newer.. more modern
04:03 <iFire> but snappydata is more optimized. like literally 10-15 years of optimizations
04:03 <iFire> or more
04:04 <iFire> I saw your conversation about cluster sql database
04:04 <mk[]> iFire: I'd like to see something like distributed DETS with a Rust backend
04:04 <iFire> but I'm hitting a roadblock where I got parts of it working, like sql queries working
04:04 <mk[]> SQL just doesn't get me excited
04:04 <iFire> mk[]: what's your goal?
04:05 <iFire> I think one of my goal is to get something done with my project as I'm really not wanting to be a database vendor
04:05 <mk[]> no goal, just wanna be able to use data structures to model data
04:05 Cohedrin joined
04:05 <iFire> mk[]: well the relational model is legitimate
04:06 <iFire> straight database structures require complicated paxoes like syncronizations
04:06 <iFire> I mean straight data structures
04:06 <iFire> mk[]: are you familiar with riak ensemble
04:07 <iFire> it provides a consistent key value db
04:07 <mk[]> iFire: no, let me take a look
04:07 <iFire> while doing all the paxos stuf
04:07 <iFire> so you can rip out like most of riak's tooling
04:07 <iFire> and just concentrate on key value
04:07 <iFire> it still has the problem with requiring 3 nodes, but you can put 3 docker nodes on one computer
04:07 <iFire> so it's not impossible
04:08 <iFire> https://github.com/basho/riak_ensemble
04:08 <mk[]> yeah, riak is a DHT, I'd like to see other DSs like linked list, set, tree etc
04:08 <iFire> huh?
04:08 <mk[]> be able to distribute regular data structures
04:08 <iFire> I'm pretty sure you can do linked tables using a key value store
04:09 <mk[]> just a crazy idea
04:09 <iFire> linked lists
04:09 Tica2 joined
04:09 <iFire> oh I've been doing linked lists by doing gets from multiple computers and doing the only one person can modify thing
04:09 mika__ joined
04:09 <iFire> and sets
04:10 <wwwd> I'm following elixir-elm-tutorial. My tests all pass and the code is running fine on my local box but when I try and push it to heroku I am getting this error: "missing :adapter configuration in config :platform, Platform.Repo". Anyone have any idea what would cause this?
04:10 <iFire> mk[]: so the idea for sets is that there's basically a global lock. and you just modify the key value
04:10 <iFire> and just use elixir's hashset
04:11 <iFire> so obviously reading doesn't require locking
04:11 <mk[]> iFire: MapSet?
04:11 <iFire> https://hexdocs.pm/elixir/MapSet.html
04:11 <iFire> and I'm pretty sure there's a property of a set that you can do a map reduce like scheme. I'm hazy on it.
04:13 <mk[]> iFire: it can be converted to a list, and list functions can be applied to it
04:13 <iFire> it's called strong consistency when you do it via a paxos algorithm, but it's functionally equivilent to one person editing it even though you're on like 50 computers
04:14 <mk[]> I don't know paxos algo
04:14 <asonge> yeah, paxos and raft are consensus algorithms and don't scale up very well
04:14 <iFire> neither does most of the computer science world
04:14 <iFire> they get it wrong multiple times
04:14 <iFire> :S
04:14 <asonge> as far as a linked list, that's basically what the blockchain is, but a linked list is pretty impossible in a crdt or something like that.
04:14 <iFire> they get it wrong that a company actually writes articles about it jokingly
04:15 <iFire> get it so wrong*
04:15 <iFire> and reviewing many distributed databases mockly
04:15 Cohedrin joined
04:15 <asonge> btw, there are some good erlang crdts that are usable
04:15 <iFire> link
04:16 <asonge> https://hex.pm/packages/types
04:16 <asonge> this is an expansion of the riak crdts that Chris Meiklejohn uses in all his lasp-related projects.
04:16 <asonge> huge number of distributed types in there
04:16 <iFire> asonge: I looked at how riak did it, and ensemble takes the approach that you have 3-5-7 concensus groups, but it's spread over say 50 machines
04:16 <iFire> so the group is chunked out
04:16 <asonge> right, but that's doing something nontrivial on top of something nontrivial :)
04:17 <iFire> and I think that's how they get past the slow down
04:17 <asonge> you don't want to choose a number higher than 7, and 3 is good for speed with decent safety, 5 is good for most anything.
04:17 <iFire> asonge: well I was suggesting just taking their ensemble algo and import it
04:17 <iFire> if one doesn't want riak
04:17 <iFire> like a mix deps import
04:18 <iFire> also crdt is different from consensur algorithms
04:19 <iFire> I believe crdts are based on eventual consistency, and paxos / raft are based on leaders
04:19 <iFire> so they pick different tradeoffs
04:20 <asonge> it's not a consensus algorithm.
04:20 <asonge> yeah
04:20 <iFire> asonge: are you familiar with any of this? https://files.readme.io/ba9c077-Architecture_Diagram.png
04:20 <asonge> very roughly.
04:21 <asonge> i stopped following distributed stuff as closely about a year ago, but i still read a paper a month
04:21 elgenie joined
04:21 <iFire> asonge: yeah I was thinking of either going with a sql db or riak ensemble (maybe embedded or with riak)
04:21 nomicflux joined
04:21 <asonge> why are you going after distribution?
04:22 <mk[]> asonge: fault-tolerance, lower latency?
04:22 <asonge> postgresql can take you really far before you really have to pay that distribution complexity cost.
04:23 <iFire> because I want to be a cluster master. Gotta catch them all. Actually I just want the thing I'm working on to scale more than one super beefy machine.
04:23 <iFire> and postgresql doesn't actually scale
04:23 <asonge> postgresql 10 is going to be interesting. there's a consensus algorithm baked in that'll be available
04:23 <iFire> I mean there's a magical switch that turns it from 10000 ops to like 120,000 but that's just one computer.
04:25 <iFire> asonge: link?
04:25 skace joined
04:25 <asonge> iFire: i'd almost prefer to break functionality out by type before distributing a ton of homogenous nodes. it'd be fast and would be easy enough to buy you the time to switch the hottest part to something more complicated
04:26 <iFire> synchronous_commit = off <- it's this switch btw
04:26 <iFire> on postgresql
04:26 <iFire> https://www.postgresql.org/docs/9.4/static/wal-async-commit.html
04:27 <asonge> hrm, i thought i read it was going to have node states and clustering on pg10, but it seems i can't find any info on it. i might've been wrong.
04:27 <iFire> asonge: you might be thinking about postgresql-xl
04:27 <asonge> most of my interests in distribution were about unreliably-networked apps
04:28 <iFire> but that's another complicated multi server stuff
04:28 <iFire> riak looks fairly simple
04:28 <asonge> oh it is, but it's also somewhat restrictive
04:28 <iFire> compared to postgresql-xl's one sync node + backup, one master + backup, n and its backup worker noders
04:29 <iFire> cockroach's deployment workflow looks better, where you just deploy n servers
04:30 <mk[]> iFire: thoughts on Couchbase?
04:30 <iFire> snappydata requires a sync node (also spark!), locators and n number of database nodes
04:30 <asonge> iFire: ah, some postgres-xl stuff is going to be merged back into postgres core, and there will be a node registry, as it's required to get logical replication to work well.
04:30 <iFire> mk[]: why not riak?
04:30 <iFire> I don't see much diference between them
04:31 <asonge> mk[]: i'm not a fan of couchdb, it violates a lot of formalisms, which makes its safety kinda...wrong.
04:31 <iFire> the better question is not syclladb (there's an ecto driver for it)
04:31 <iFire> http://www.scylladb.com/
04:31 <asonge> unless they changed the way they resolve write conflicts
04:32 <mk[]> iFire: RAM caching?
04:32 <iFire> mk[]: ?
04:32 <asonge> caches are just another word for distributed data.
04:32 <iFire> well computers are clusters in a single node anyways
04:33 <iFire> even with the 4 cores we have on desktops
04:33 <mk[]> iFire: Couchbase has a distributed RAM cache built-in
04:33 <asonge> ouch.
04:33 <iFire> mk[]: yeah I can also run my db in ram too
04:33 <mk[]> asonge: what do you mean by safety?
04:33 <* asonge> wouldn't want to run that.
04:33 <asonge> mk[]: that the data can become inconsistent even if you do everything right on your end.
04:33 <iFire> that's why I wrote the snappydata ecto, but I don't have enough help to get over the hump
04:34 <iFire> it just means async writing to disk
04:34 <asonge> like, there's no way to have master-master replication in couchdb and not lose data
04:34 <iFire> like that above postgresql option
04:34 <asonge> even if all writes are observed and there isn't a split-brain
04:35 <mk[]> asonge: Couchbase does have a smell. They claim both high availability and consistency
04:35 <iFire> :)
04:35 <asonge> yeah, that's also known as a lie :)
04:36 <asonge> basically, if you manage to write to the same key on 2 masters, the last write on the one with the most writes since they last saw each other wins. but if it's a tie even after that, the entry with the biggest checksum wins.
04:38 <mk[]> all of those algorithms give me heachaches :)
04:38 wpcarro joined
04:39 <asonge> i think you should decide on what properties you actually want, and then shop for the db based on that.
04:40 <iFire> asonge: I don't think he actually has an application
04:40 <asonge> :)
04:40 <asonge> architecture astronauting is fun
04:40 <iFire> asonge: can I pm you
04:40 <asonge> sure?
04:41 <mk[]> well, I wanna build an email server, and want a simple DB for it
04:41 <mk[]> no reason for it to be distributed, but it'd be nice for fault-tolerance
04:44 <iFire> I don't see how an email server is interesting, but people have other tastes
04:44 <asonge> for an email server, i'd personally consider using something like postgresql for all the metadata and storing object data in an object store like s3 or google's whatever or riak's large object thing
04:45 <mk[]> iFire: what do you find interesting then?
04:45 <iFire> I'm interested in multiplayer computer games
04:45 <asonge> advantage there is that metadata is lightweight, can be replicated quickly in read-replicas, and you can probably shove whatever data is really "hot" into some other kind of database (depending on access pattern)
04:46 Cohedrin joined
04:46 <iFire> also email has a property of write only
04:46 <mk[]> iFire: I see. I don't play games, haha. But I like communication systems, and view computers as fancy telephones
04:46 <iFire> immutable
04:46 <* asonge> is more on mk[]'s side.
04:46 <asonge> i think there are a few people interested in an elixir MTA
04:48 steffkes joined
04:48 steffkes joined
04:48 <mk[]> MTA?
04:49 <asonge> mail transfer agent...the whole suite of smtp/imap/spam-filter/etc
04:49 <mk[]> asonge: the access pattern will probably be websockets, so the client is immediately notified without long polling
04:50 <asonge> yeah, that's the easy part :)
04:51 <asonge> though you'd probably want to use websockets as a control channel and have the client pull data via web request
04:51 <asonge> for the email messages and images and downloads and such
04:51 <mk[]> asonge: I found gen_smtp, seems to work fine, though I haven't tested it much
04:51 akeating joined
04:51 <iFire> mk[]: phoenix has a channels implementation
04:52 <iFire> it's based on websocketw
04:52 <iFire> websockets*
04:52 <iFire> it's a pub sub thing
04:52 <iFire> probably better than using the erlang version of zeromq 4
04:53 <iFire> already has distribution over n nodes baked in
04:54 <mk[]> iFire: I may just use Plug without Phoenix https://hex.pm/packages/web_socket
04:54 <iFire> I'm saying phoenix + channels because in 2015 they wrote about how they can send 2 million messages
04:57 <mk[]> iFire: maybe so, I'm not interested in performance, but simplicity
05:01 jkreeftmeijer joined
05:03 gvaughn joined
05:04 griffinbyatt joined
05:07 Bounga`` joined
05:12 justelex joined
05:14 elgenie joined
05:19 cemilowski joined
05:20 sfbw joined
05:21 Bounga`` joined
05:26 justelex joined
05:32 gokr joined
05:34 ctp joined
05:34 wpcarro joined
05:37 imack joined
05:40 robinsjdotcom joined
05:55 cemilowski joined
05:56 Cohedrin joined
06:03 cschneid_ joined
06:04 griffinbyatt joined
06:05 cemilowski joined
06:12 codestorm joined
06:26 luminarys joined
06:29 wpcarro joined
06:31 icanhazbroccoli joined
06:32 milad joined
06:35 tuacker joined
06:36 robinsjdotcom joined
06:37 <Tica2> Hi! I have s3 compatible client library implemented for :mem, :disk and :s3 and I run tests with @dbtype :s3 and @dbopts […]
06:38 <Tica2> is run fine for @dbtype :mem and @dbopts […]
06:39 <Tica2> how is the best update test to run tests for :s3 :mem and :disk?
06:44 <Tica2> gist for details: https://gist.github.com/petricachiriac/0a36e992341b4ed1a152a872e58ad7e6
06:49 steffkes joined
06:50 refriedchicken joined
07:01 cemilowski joined
07:03 jkreeftmeijer joined
07:05 elgenie joined
07:06 griffinbyatt joined
07:06 milad joined
07:06 Guest67 joined
07:11 nd___ joined
07:11 r00tl3ss joined
07:15 ZippoWeb joined
07:18 nd___ joined
07:21 sfbw joined
07:23 PaReeOhNos joined
07:23 mark_66 joined
07:26 craigp joined
07:27 mattyw joined
07:29 steffkes joined
07:29 steffkes joined
07:32 milad joined
07:35 asabil joined
07:36 colrack joined
07:42 asabil joined
07:49 yourname_ joined
07:56 koneko joined
07:56 awea joined
07:58 asabil joined
07:58 akeating joined
07:59 Guest67_ joined
08:03 akeating joined
08:04 <smeevil_> o/
08:04 craigp joined
08:05 jkreeftmeijer joined
08:06 griffinbyatt joined
08:12 Bounga`` joined
08:13 josevalim joined
08:14 bitmod joined
08:16 jkreeftmeijer joined
08:17 PaReeOhNos joined
08:17 wpcarro joined
08:21 voltone joined
08:21 elgenie joined
08:31 skace joined
08:31 <OliverMT> circleci 2.0 pretty good
08:31 <* OliverMT> warming up to docker
08:32 <OliverMT> after hating it for three-four years :D
08:36 codestorm joined
08:37 marr joined
08:38 meandi joined
08:45 inoas joined
08:47 stephen_m joined
08:52 ZippoWeb joined
08:57 Cohedrin joined
09:00 dch_ joined
09:03 sfbw joined
09:07 jkreeftmeijer joined
09:07 griffinbyatt joined
09:11 lexmag joined
09:13 vmoravec joined
09:27 robinsjdotcom joined
09:32 lopex joined
09:33 mika__ joined
09:33 codestorm joined
09:37 hbraun joined
09:39 adgtl left
09:45 penthief joined
09:53 jkreeftmeijer joined
09:57 inoas joined
10:04 jkreeftmeijer joined
10:06 wpcarro joined
10:06 <nox> OliverMT: What does it do differently than Travis?
10:08 griffinbyatt joined
10:10 robinsjdotcom joined
10:11 craigp joined
10:16 <steffkes> hey guys, hopefuly easy question - while getting along with elixir and loving pattern matching, i'm finding myself often in a situation where my code looks like this:
10:16 <steffkes> defp handle(data = %{"type" => "event_callback", "event" => %{"type" => "message", "subtype" => "group_leave", "user" => user_id}}) do
10:16 <steffkes> how do you typically format this? because this line counts 137 and there are others which are probably even longer than this. but already at this length i find it hard to read
10:17 <steffkes> i did check christopheradams/elixir_style_guide but didn't see a section that would apply. or did i just miss it?
10:18 <ciawal> you could have that function call another one
10:18 <ciawal> passing only the event mpa
10:18 <ciawal> map
10:18 <ciawal> then you have less repeated and shorter matching
10:20 <steffkes> hm yeah .. you mean to pass along the matching of the event structure to another function? didn't think about that
10:21 <steffkes> still feels a bit quirky .. because not really needed. but actually makes the code more pretty, that is right
10:21 <ciawal> if you're handling multiple event types then it's better for sure
10:21 jkreeftmeijer joined
10:22 <steffkes> i do, or actually plan to. to me it feels more natural the way i've pasted above. because i have one function that either does match or doesn't. otherwise a catch-all is matched.
10:22 akeating joined
10:22 <steffkes> if i'd refactor the matching for event .. i'd have another level of indirection. and would need a catch-all for this as well
10:23 <ciawal> well I think this is better
10:23 <ciawal> now you differentiate between receiving a event_callback you don't match, or any other kind of message
10:23 <ciawal> with your current pattern you can't tell the difference
10:23 <ciawal> in terms of error handling
10:25 <steffkes> okay, i can go with that. at least for the events .. now i have another kind of command message, which doesn't have a nested struct .. just a few properties, like this:
10:25 <steffkes> defp handle(data = %{"command" => "/test-01", "user_id" => user_id, "text" => text, "response_url" => response_url}) do
10:25 <steffkes> the line is not that long (112 chars) but already is pretty long.
10:26 <steffkes> i probably can remove the "data = " part since i don't need it anymore. but the question still applies for me
10:26 <ciawal> I think I'd leave that as-is personally
10:26 <steffkes> or is the answer kinda always like "use another function to get a shorter pattern"? :D
10:27 <ciawal> well, you can format it as you like ofc, but I don't think there's any set style for it
10:27 <ciawal> to me that's not quite long enough to split yet I think, especially if you can remove the data
10:27 gvaughn joined
10:28 dimitarvp joined
10:29 <mika__> one thing you could do if you want to make it shorter is remove anything that isn't strictly used for switching
10:29 mbwe joined
10:29 <mika__> for example, (it's an assumption) you could remove `user_id`
10:29 <mika__> and in the function instead use `data.user_id`
10:30 <steffkes> yeah indeed, that is what i had in the beginning .. and then i switched to using that style, but i don't remember why ;o which is why those lines get that long
10:30 <ciawal> you could match on _ to do this also if you wanted
10:31 nd____ joined
10:31 <mika__> ^
10:31 <ciawal> defp handle(%{"command" => "/test-01", "user_id" => _, "text" => _, "response_url" => _}) do
10:31 <steffkes> hm .. okay, i'll play around with it a bit more and see how it goes along
10:38 <josevalim> micmus: do you remember which functions from httpd/httpc in inets you wanted to use?
10:39 rkazak joined
10:41 gmcabrita joined
11:01 elgenie joined
11:01 cschneid_ joined
11:04 sfbw joined
11:04 t4nk503 joined
11:05 <t4nk503> How can I use eprof with elixir?
11:06 rodolfojcj joined
11:08 cevado joined
11:08 griffinbyatt joined
11:31 adgtl joined
11:31 asabil_ joined
11:33 <OliverMT> nox: not sure, it came before I think? :P
11:33 <OliverMT> I went from wercker to circle
11:34 malteof[m] left
11:34 jkreeftmeijer joined
11:36 chrismccord joined
11:41 bitmod joined
11:41 <bitmod> git
11:42 <OliverMT> No changes
11:42 nighty-- joined
11:53 <Tica2> OliverMT: Greetings
11:53 <OliverMT> hello!
11:54 <Tica2> back to Elixir :)
11:54 wpcarro joined
11:57 ZippoWeb joined
11:58 micmus joined
11:58 <micmus> josevalim: HTTP datetime parsing
12:01 cristianR_ joined
12:03 akeating joined
12:08 griffinbyatt joined
12:09 mattyw joined
12:22 nomicflux joined
12:25 Dev0n joined
12:28 wpcarro joined
12:32 josevalim joined
12:32 akeating joined
12:35 thurloat[m] joined
12:37 <thurloat[m]> elixir newbie here, have a question about importing. cowboy has a urlencode function in its cow_uri module, but I can't for the life of me get it imported to use.
12:37 PaReeOhNos joined
12:37 <thurloat[m]> Is there anything special you have to do to import erlang stuff in elixir?
12:39 <Theophane> thurloat[m]: has `import :cow_uri` worked?
12:40 <thurloat[m]> ...
12:40 <thurloat[m]> thanks, lol. I was trying to namespace it
12:42 <Theophane> :)
12:43 <* nox> wonders which spec that follows.
12:43 <thurloat[m]> and it looks like I can just invoke cow_uri functions bare (urlencode(x)) vs. with the full path :cow_uri.urlencode ?
12:43 <thurloat[m]> at least that's what my linter is saying
12:44 <micmus> well, that's what importing a module does
12:45 <thurloat[m]> right! I'd `require` if I wanted to have the module name too, right?
12:45 <nox> Oh,
12:45 <nox> Cowboy uses W3C specs, ah ah ah ah
12:46 <micmus> thurloat[m]: no, you can "just" call any module as long as it is compiled.
12:47 <micmus> import is to enable calling "bare" functions from the module, require is to enable macros from the module
12:47 <Theophane> thurloat[m]: nah "require" imports macros
12:47 <thurloat[m]> flips desk
12:48 <thurloat[m]> thanks for the help, all. I'm at least moving down the road :)
12:48 <benwilson512> Theophane: when you say "require imports macros" what do you mean?
12:48 <benwilson512> if you do `require Foo` and Foo has a macro bar, you still need to do `Foo.bar`
12:48 <benwilson512> not just `bar`
12:49 <benwilson512> import imports macros, require merely permits you to call them
12:49 <Theophane> oops
12:49 <Theophane> sorry
12:49 <benwilson512> thurloat[m]: if the module is loaded in the VM, you can always just call functions on the module
12:49 <benwilson512> no requiring / importing / anything else is necessary
12:50 <thurloat[m]> benwilson512: thanks for the clarification.
12:50 <thurloat[m]> so without doing `import :cow_uri`, I should just be able to invoke `:cow_uri.urlencode` anywhere.
12:51 wpcarro joined
12:54 <benwilson512> yes
12:54 ctp joined
12:54 <benwilson512> if it's a third party library it obviously needs to be listed in your mix.exs file so it can be loaded
12:54 <thurloat[m]> right
12:59 ramortegui joined
13:02 cschneid_ joined
13:02 vadviktor joined
13:04 koneko joined
13:05 sfbw joined
13:05 JEG2 joined
13:07 bitmod joined
13:09 fap[m] joined
13:17 gokr joined
13:17 noeljackson joined
13:21 <benwilson512> chrismccord: non technical ping
13:21 griffinbyatt joined
13:21 robinsjdotcom joined
13:23 craigp joined
13:25 wpcarro joined
13:31 akeating joined
13:32 kronicdeth joined
13:35 cschneid_ joined
13:35 jleon joined
13:35 jmiven joined
13:36 jkreeftmeijer joined
13:38 <m1dnight_> Hey guys, im going along in the book of chris mccord for phoenix and my migration fails
13:38 <m1dnight_> goes without saying that in the beginning of the book and I don't know anything about phoenix
13:39 <m1dnight_> https://hastebin.com/tafemamewo.php
13:39 <m1dnight_> This is the error im getting. and i verified my migration is correct
13:39 <m1dnight_> could it be permissions on postgres?
13:39 <benwilson512> can you show me the migration code?
13:39 <benwilson512> oh also your config for your database
13:39 <m1dnight_> https://hastebin.com/siyoyosava.sql
13:39 <m1dnight_> sec
13:40 <m1dnight_> https://hastebin.com/oxonububam.rb <db config
13:40 <benwilson512> you have a trailing string on line 8 btw
13:40 <benwilson512> trailing comma rather
13:40 seanclayton joined
13:40 seanclayton joined
13:40 <m1dnight_> ughhh
13:40 <m1dnight_> kill me now if that was the bug
13:40 akeating joined
13:40 <m1dnight_> sorry about this guys
13:40 <m1dnight_> must have read over it, three times :p
13:40 <benwilson512> did that fix it?
13:40 <m1dnight_> yeps
13:41 <benwilson512> yay! not an optimal error
13:41 <m1dnight_> thanks a lot :) that was stupid of me
13:41 <benwilson512> but basicaly whatever timestmaps returns was being treated as options
13:41 <benwilson512> for the field prior
13:41 <benwilson512> because of the trailing comma
13:41 <thurloat[m]> oh that's sneaky
13:47 wpcarro joined
13:47 gvaughn joined
13:51 bpmcd joined
13:52 ikcerog joined
13:53 cevado joined
13:59 wpcarro joined
13:59 cdg joined
14:00 drewolson joined
14:02 elgenie joined
14:03 Machete joined
14:07 steffkes joined
14:07 steffkes joined
14:14 hotpancakes joined
14:14 <hotpancakes> Hi, quick question. `0 < x < 10` when x = 5 seems to be valid syntactically, but unexpectedly returns false. Any idea why?
14:15 <Nicd-> it probably evaluates one side first into true and then compares true with a number
14:15 <hotpancakes> Ah, okay
14:15 <benwilson512> hotpancakes: you want `0 < x and x < 10`
14:16 <hotpancakes> benwilson512: yup, I was just curious as to why the former evaluated to false
14:16 <benwilson512> yeah Nicd- nailed it
14:16 <Nicd-> Python is the only language I know with a special case for x < y < z
14:18 jleon joined
14:22 griffinbyatt joined
14:22 ZippoWeb joined
14:24 cevado joined
14:27 <hotpancakes> One more: why does adding `.body` to the end of the function call on line 2 work? (Looks suspiciously like function chaining to me) https://gist.github.com/anonymous/20e5508527c955e0d9ac26ee146a3f0e
14:29 <hotpancakes> Is it just the dot notation to access map keys?
14:29 <Nicd-> it's a shortcut for [:body]
14:29 <gazler> https://elixirforum.com/t/the-issue-with-the-static-access-operator-the-dot/4509
14:29 jerel joined
14:31 cdg_ joined
14:32 <chrismccord> benwilson512 non-technical pong
14:37 InternetFriend joined
14:37 jkreeftmeijer joined
14:38 wpcarro joined
14:40 jleon joined
14:40 <thurloat[m]> gazler: thanks for posting that, as a noobie it made clear a lot about how all that works.
14:40 <gazler> thurloat[m]: No problem. I'm sure it is documented somewhere, I just can't think where.
14:43 robinsjdotcom joined
14:43 Guest67_ joined
14:59 sfaxon joined
15:04 squallstter joined
15:05 akeating joined
15:06 <hotpancakes> I know this is probably super simple, but what's the best way to view nested maps, making them more human readable?
15:07 <hotpancakes> I'm consuming an API with elixir and parsing w/ poison but the nested structure is pretty unreadable.
15:07 gokr joined
15:07 akeating joined
15:08 <benwilson512> for json specifically you can re-encode w/ poison pretty: true and |> IO.puts
15:08 <benwilson512> if taking the decoded map and |> IO.inspect is hard to read
15:09 <hotpancakes> benwilson512: thanks!
15:10 nope3000 joined
15:11 rodolfojcj joined
15:17 cschneid_ joined
15:20 <ciawal> apex on hex tries to help with this also
15:22 cevado joined
15:23 griffinbyatt joined
15:24 hotpancakes joined
15:24 akeating joined
15:27 the_voice- joined
15:27 renl joined
15:28 <renl> has anyone used Elixir in a robotics project yet?
15:35 akeating joined
15:37 drincruz joined
15:37 tuacker joined
15:38 icecreamcohen joined
15:38 hotpancakes joined
15:45 davidw joined
15:48 wpcarro joined
15:52 meh` joined
15:56 amclain joined
15:57 <alisdair> i used erlang in an autonomous drone project years and years ago
15:57 <alisdair> nerves probably makes elixir even better suited to it
15:59 Lex[m] joined
16:01 wpcarro joined
16:04 <benwilson512> least favorite performance bug to chase down: something is much faster than something else but it shouldn't be
16:05 PaReeOhNos joined
16:06 <renl> alisdair: what do you think are the possible pitfalls of using elixir/erlang in a robotics project? thinking of using elixir in a robotics project for the concurrency and the supervision tree, but i was thinking it is not widely used and there is probably a reason
16:06 <icecreamcohen> benwilson512: It almost invariably means you’re not doing something you should be.
16:07 hotpancakes joined
16:07 <alisdair> i think it's not widely used because it's not widely known
16:07 <benwilson512> icecreamcohen: precisely :(
16:07 <alisdair> but it was a good fit for us
16:08 steffkes joined
16:08 steffkes joined
16:08 <icecreamcohen> benwilson512: We deployed an elixir spam system before, and it was like, 20x faster than the one it replaced. But we only changed the thrift server.
16:08 <alisdair> we needed something with high throughput and near real time (no gc pauses)
16:08 <notriddle> icecreamcohen: Spam Filtering, right?
16:08 <icecreamcohen> yes
16:08 <benwilson512> lol
16:09 <icecreamcohen> turns out, we weren’t processing the most prevalent event.
16:09 <icecreamcohen> whoops.
16:09 <benwilson512> that'll do it
16:09 <benwilson512> yeah in this case I have a graphql doc with a set of fields, and I'm adding MORE fields under a type condition that won't match
16:09 <benwilson512> so it shouldn't be slower
16:09 <benwilson512> but it sure as hell shouldn't be faster
16:10 <notriddle> https://twitter.com/anholt/status/851568482558787584
16:11 <benwilson512> heh
16:11 <icecreamcohen> benwilson512: have you been talking to Jon?
16:11 wpcarro joined
16:11 <benwilson512> icecreamcohen: no, although i do plan on finding him at elixirconf next week
16:11 <benwilson512> fishcakez will be there too
16:11 <icecreamcohen> I’m bummed I’m not going.
16:11 <icecreamcohen> uh-oh, he just got pinged
16:11 <benwilson512> ah oops
16:12 meandi_2 joined
16:12 <renl> alisdair: thanks that was reassuring. so you used erlang port to interface with sensor/motion control drivers
16:12 jeffweiss joined
16:13 <icecreamcohen> benwilson512: he makes it very hard to even get *close* to his nick without pinging him.
16:13 <benwilson512> indeed
16:14 <notriddle> Call me cynical, but I figure the more optimization passes the Erlang compiler and BEAM runtime grow, the more unpredictable the performance is going to get. I think it's already possible to get yourself into a situation where removing a function call makes your code slower...
16:14 rodolfojcj joined
16:15 <icecreamcohen> notriddle: you’re cynical ;)
16:20 bitmod joined
16:22 wsieroci joined
16:23 griffinbyatt joined
16:27 hotpancakes joined
16:28 cemilowski joined
16:28 milad joined
16:29 PaReeOhNos joined
16:30 <micmus> notriddle: then you're going to have a very bad time using any modern compilers or JIT-compiled languages
16:30 <micmus> Most of them do way more crazier optimizations than erlang compiler
16:31 <icecreamcohen> notriddle: btw, my tongue was firmly in my cheek there…
16:31 <jer> in my genserver, if i want to recursively call the logic in a handle_call function, would be best to refactor out the recurisve calls into its own private function, right?
16:31 <icecreamcohen> *and* a lot of the erlang optimizations are really hard to realize (but worth it)
16:31 <jer> where best = idiomatic
16:32 ejpcmac joined
16:32 hakunin joined
16:32 <icecreamcohen> jer: I find myself doing that, but I don’t know if it’s idiomatic or not.
16:32 <notriddle> Yes, I agree that "unpredictable fast-ish" is much better than "predictably too slow to be usable"
16:32 <jer> gotcha
16:33 <icecreamcohen> notriddle: I strongly suspect that in this case, there’s something that’s not being done.
16:33 cevado joined
16:33 <icecreamcohen> in my above story, we were omitting 90% of events. When we re-added them, perf was only 10% faster.
16:33 <micmus> notriddle: though, I understand your point - e.g. lately there's a lot of C programs broken because compiler took advantage of some undefined behaviour
16:35 <notriddle> That's good, because I'm not sure what point I was actually trying to make. 😄
16:37 <icecreamcohen> I *think* you were making the point that performance is hard enough, and becomes even harder when the whole environment makes choices you might not be aware of.
16:37 <icecreamcohen> which makes sense.
16:38 jkreeftmeijer joined
16:40 cevado joined
16:41 ikcerog joined
16:43 gvaughn_ joined
16:44 jkreeftmeijer joined
16:44 gvaughn__ joined
16:46 akeating joined
16:47 sfaxon joined
16:49 wpcarro joined
17:05 wpcarro joined
17:06 codestorm joined
17:07 elgenie joined
17:09 mika__ joined
17:12 Cohedrin joined
17:16 milad joined
17:16 PaReeOhNos joined
17:17 imack joined
17:21 ZippoWeb joined
17:22 <notriddle> Makes sense.
17:24 griffinbyatt joined
17:26 hotpancakes joined
17:27 InternetFriend joined
17:34 wpcarro joined
17:36 asabil joined
17:37 rodolfojcj joined
17:40 akeating joined
17:46 milad joined
17:49 <codestorm> benwilson512: sorry for the interrupted conversations the other day.... so I wanted to be clear about casing with Absinthe. It looks like the GraphQL queries are camel case and are translated to elixir's snake case
17:49 <benwilson512> codestorm: lol it's unfortunate you disconnected
17:49 <benwilson512> I rambled on for a while
17:49 <benwilson512> let me see if I can get the history
17:50 <codestorm> oh bummer. thanks
17:51 <benwilson512> codestorm: https://botbot.me/freenode/elixir-lang/2017-04-25/?msg=84713476&page=6
17:52 gvaughn joined
17:52 ZippoWeb joined
17:52 <codestorm> thanks, reading now
17:53 gvaughn_ joined
17:56 apotry joined
17:57 rodolfojcj joined
17:59 hotpancakes joined
17:59 <codestorm> benwilson512: so is GraphQL usually camel by convention, regardless of the language backing the server?
18:01 hotpanca_ joined
18:04 gvaughn_ joined
18:05 <thurloat[m]> #noobquestion trying to do stuff with this data, initially thought it was a map, then thought it was a list of maps, but I'm not sure what it is now. https://hastebin.com/ibenekekal.pl
18:06 <thurloat[m]> [ { "asdf", "fdsa" }, ]
18:06 <thurloat[m]> google says it's a tuple. damnit
18:07 josevalim joined
18:08 <josevalim> MononcQc: do you share loic's opinion that the pair should be handle_call and handle_info? or do you think handle_cast still has its place?
18:08 <micmus> thurloat[m]: it's a list of two-element tuples. There's i/1 helper in iex that will describe the data type
18:10 <MononcQc> josevalim, yeah I think handle_cast still has its place
18:10 <MononcQc> I mostly didn't find much of a problem with the way things were before that whole patch
18:11 <MononcQc> code_change and terminate being optional is okay with me though
18:11 <josevalim> MononcQc: assuming we have gen_server:send/2 which is basically gen:whereis(Via) ! Msg, when would you use cast?
18:12 <MononcQc> Difference between calls coming from the API and those from outside the API
18:13 <MononcQc> I would likely not use gen_server:send because now I gotta put all that shit in the same place and I quite enjoy the separation
18:13 lexmag joined
18:14 nd___ joined
18:16 <MononcQc> in the best most positive spin I can put on it, it's a nearly useless change that just breaks old code or makes 20 year of tutorials confusing all of a sudden
18:16 Machete joined
18:16 <josevalim> it doesn't break any old code though, does it?
18:17 <josevalim> MononcQc: and thanks for the info btw :D
18:17 <MononcQc> frankly the idea that the difference between the name "call" and "cast" is one of the hurdles turning people away is completely unfounded and my opinion is that decades of shitty tooling have far more to do about it than anything else
18:17 <MononcQc> but I made a whole keynote about that last year
18:18 <josevalim> MononcQc: oh, i don't think anybody is leaving because of that
18:18 <josevalim> my point of view between call and cast is that call is prefer most times and i would prefer to put the spotlight on call
18:18 <MononcQc> for me it's the difference between "I want a response" and "fire and forget"
18:19 powelljf3 joined
18:19 steffkes joined
18:19 steffkes joined
18:21 bitmod joined
18:21 refriedchicken joined
18:22 <josevalim> MononcQc: i was going to propose to keep call and info around but if there is no consensus, i will just leave it be
18:23 milad joined
18:23 <MononcQc> yeah I don't quite get what it would yield
18:23 <MononcQc> I,m still confused as hell as to why people weren't just okay removing the -behaviour(gen_server) line if they hated the warnings so much
18:23 <asonge> MononcQc: it's why i hopped on elixir so fast, 0.12 days. i finally felt that someone smarter than me had set up tooling well, and i didn't get a handful of parts that i could assemble in all sorts of ways.
18:23 <MononcQc> it would have saved everyone a lot of time and given the same result for the most part
18:24 <asonge> it bothers me that people think it's a good thing that it can take a day to set up a project the way you want it. and it's always going to have downsides :/
18:24 <MononcQc> asonge, yeah. That stuff prompted me to sink a lot of time on rebar3, which hopefully leveled the playing field a bit
18:25 <josevalim> MononcQc: the other option is to ensure we emit proper warnings for missing handle_call, handle_info and handle_cast and if someone wants to skip those they can define a mini_gen_server with only the stuff we need
18:25 <asonge> i hope a lot of people benefit from it. some seem to have bought into using hex with rebar, so that's nice.
18:27 <MononcQc> josevalim, I would have kept the warning and made noops of them if we really really had to make them optional
18:28 <MononcQc> it all feels so wrong from a fail-fast perspective though
18:28 <MononcQc> handle_call with no impl should {noreply, State} to let the caller die, what the fuck is it doing anyway
18:28 <MononcQc> but letting the server explode kills more processes so thats good
18:28 <josevalim> shouldn't handle_call and handle_cast just fail?
18:28 <MononcQc> yes they should
18:28 <MononcQc> I'm saying if you had to provide a default impl
18:28 <josevalim> i think people were really insecure about making handle_info just fail though?
18:29 griffinbyatt joined
18:29 <MononcQc> like I'd just keep handle_info silent and make a very loud compile warning
18:29 <MononcQc> I find it stupid to remove the compile time warning to replace it with a run-time one that takes resources for the same reuslt
18:29 <MononcQc> it's bad
18:29 dch_ joined
18:29 hotpancakes joined
18:29 <josevalim> MononcQc: well, one is always triggered, the other only when needed :P
18:29 <MononcQc> like if you have to make it ignore shit, tell about it at compile time
18:29 <MononcQc> if you don't want a warning, fix your code
18:29 <MononcQc> otherwise deal with the warning
18:30 <MononcQc> I'd rather have it once at compile time than 50 times an hour in a log file that takes resources
18:30 <MononcQc> I don't give a shit if it looks prettier when it compiles without warning, it's a worse behaviour IMOP
18:30 <MononcQc> IMO*
18:31 <MononcQc> like as a user, what the hell can I do with a log that tells me to patch code?
18:31 <asonge> MononcQc: pretty sure you're the sane one here.
18:31 apotry joined
18:31 <josevalim> well, supposedly it is not mean to be called
18:31 <josevalim> i am not sure if the default that everyone uses is any better or worse
18:31 <josevalim> which is to just discard everything
18:32 <MononcQc> yeah that's my point there. If there is no good default then what the fuck are we doing providing one?
18:32 <MononcQc> now the default is "discard everything and warn at runtime"
18:33 <josevalim> is it better than discarding everything? because that's effectively what everyone uses?
18:34 <asonge> you guys have a link to the original argument about this, for context?
18:34 <josevalim> asonge: you don't want to go there
18:34 <josevalim> you are welcome
18:34 <josevalim> :P
18:34 <asonge> you don't know me, you don't know my life. :)
18:34 <asonge> (i kid)
18:36 mozzarella joined
18:36 dimitarvp joined
18:37 ivan joined
18:38 ivan joined
18:38 <asonge> and...you were 100% right.
18:38 <m1dnight_> "Sure, the resources macro has been known to reduce CTR almost as much as an ergonomic workspace" :D :D (context: the Phoenix book)
18:38 ngr_ joined
18:38 chrisarc1nd joined
18:38 saurik_ joined
18:38 phansch_ joined
18:38 abort_ joined
18:38 MonononcQc joined
18:41 irclogger_com joined
18:41 Topic for
18:42 rodolfojcj joined
18:43 maaarcocr joined
18:44 <MonononcQc> https://github.com/erlang/otp/pull/1346#issuecomment-297803811 here's the long opinon
18:45 junsuiji1 joined
18:45 wpcarro joined
18:46 <jer> that moment when you can almost audibly hear when a coworker (a clojure programmer) "clicks" with what supervision trees are and why they're useful, and on how GenStage works... he's just now itching to go write more elixir code heh
18:47 <josevalim> MonononcQc: good points. but I still think you did not consider the argument that it is not supposed to warn at all
18:47 <josevalim> MonononcQc: I am not trying to be difficult btw, I don't have a horse on this race, I think. if I do it is a small one
18:47 <MonononcQc> "You could also argue that no warning is acceptable (I don't really agree either, but can begrudgingly concede if you instead mention it a lot in the docs and then point people to it)"
18:48 <MonononcQc> the usual path goes "you can send messages with !" and then you start using OTP and the messages vanish silently
18:48 <MonononcQc> so I prefer a warning
18:48 <MonononcQc> If you don't provide a warning in the code or compiler or run time, then maybe in the doc is fine
18:48 MotherFlojo joined
18:48 <MonononcQc> but I'd rather get compile-time warnings
18:50 rkazak joined
18:57 <asonge> josevalim: there is something nice about defoverridable (and also that it's superpowers are mostly hidden from most mortals) in letting you experiment with this stuff yourself.
18:58 m_m joined
18:59 wpcarro joined
19:04 <ejpcmac> MonononcQc: I’ve read some of your comments on GitHub, and I completely agree with you. When I started to learn Elixir a few weeks ago, one of the cool stuffs I found about the language is that this is a compiled language, so you can get compile-time warnings and errors. I think this helps you to write better and safer code, and making some warnings related to implementation to be at runtime rather than compile-time is a nonsense imo.
19:05 <MonononcQc> good to hear
19:07 cevado joined
19:07 <josevalim> MonononcQc: I am still not convinced because I think I value the trade-offs slightly different than you but I think your replies definitely covered all bases
19:08 <josevalim> I still think saying you have to imeplement handle_info, handle_call and handle_cast before you even get started is just too much
19:08 <josevalim> I think the fact people have to resort to templates is almost always a flaw somewhere
19:09 elgenie joined
19:09 <MonononcQc> I think that could be addressed by the nature of the callback warning
19:09 <MonononcQc> but the machinery may not be all in place for it
19:09 <MonononcQc> like having an optional callback could just warn with something like "the <X> callback is missing and a default option will be provided"
19:10 <MonononcQc> I figure the thing you see as problematic is that the warning looks a lot like an error to the newcomer
19:10 <asonge> MonononcQc: you could also just suppress the warning in the module using some module attribute.
19:10 <josevalim> yup, and most people should aim for the code to compile without warnings
19:10 <asonge> which is an acknowledgement that you know what the behavior is.
19:10 <MonononcQc> yeah but that doesn't fly well from the newcomer approach
19:10 <MonononcQc> (the attributes that is)
19:11 <asonge> i think it fulfills a requirement that writing code is a dialogue with the computer :)
19:11 <micmus> josevalim: I'm not entirely convinced to logging because of one thing - if I implement one case, now I loose all the logging, etc
19:11 craigp joined
19:11 <josevalim> micmus: a very good argument too
19:11 <micmus> asonge: I guess supressing warning with an attribute, wouldn't be much different from proving the default implementation
19:11 <MonononcQc> people should get acquainted with the 3rd/4th option of gen_server:start_link that gives you a possible trace of all the eevents going on :V
19:12 <MonononcQc> (that and the sys module, the wonder module)
19:12 OtherAllan joined
19:12 <ryanwinchester> can anybody confirm that using cast_assoc along with Repo.update _should_ insert a new associated model?
19:12 <micmus> It could make sense to have something like GenServer.default_handle_info/2 for cases where the default is provided, so it's easy to delagate to it
19:12 <josevalim> ryanwinchester: it should if there are no errors
19:13 <josevalim> micmus: yes
19:13 <josevalim> warn_unhandled_info rather
19:13 <micmus> right now with elixir that would be using super() for the pokemon clause, but I'm not a huge fan of that, and it's not used widely
19:15 <ryanwinchester> so I have Registration.complete_changeset here: http://s.ryanwinchester.ca/223t2C1J2a2C
19:15 <tristan__> I think it should keep the messages in the queue forever if you don't handle them
19:15 Machete joined
19:16 laut joined
19:16 <ryanwinchester> this should fail if a "user" map is not provided, and then i would assume if it succeeds, that i would have a new user
19:16 <tristan__> but would require conditionally compiling the gen_server code to only match on the functions you export :(
19:16 <Zarathu> is there a "standard" way for phoenix controllers to respond to different formats? json/html
19:16 <Zarathu> google is giving me a few different ways of doing this
19:16 <josevalim> tristan__: impossible with downs for example and then you may have a leak for unknown messages
19:17 <chrismccord> Zarathu : yes, but it depends if you need to perform different code paths or fetch different data
19:17 <tristan__> josevalim: right, as you'd expect from sending messages you don't match for
19:17 <josevalim> *memory leak
19:17 <chrismccord> if it's only data representation, you can pass a tuple to render, which will take care of rendering the corresponding template
19:17 <chrismccord> `render(conn, :index, ...)`
19:18 <chrismccord> will render index.html or index.json for example
19:18 <tristan__> if you want a catch all in a receive that does nothing you have to define it, why should gen_server have one by default
19:18 <Zarathu> chrismccord: the controller action *does* the same thing if it has the same name
19:18 <Zarathu> passing a tuple to render though... example?
19:20 <micmus> Zarathu: the main problem is that usually you need to do widely different things for regular http & json api endpoints
19:20 <chrismccord> Zarathu : sorry, passing an *atom to render
19:20 <chrismccord> example agove
19:20 <micmus> so it's not just about the format
19:20 <Zarathu> ahh!
19:20 <tristan__> weird, I completely disagree with the idea of not including cast by default. I almost think beginners should get the feeling they should always use cast, not call, hehe
19:20 <chrismccord> Zarathu : you could pass the get_format(conn) to your acdtions and match on it in different clauses
19:20 <micmus> e.g. for html you need to set flash messages, or redirect, which does not happen for REST APIs
19:20 <chrismccord> but typically as micmus said, they deviate enough that separate controllers is generally the way to go
19:20 <chrismccord> different pipelines and such
19:21 <tristan__> oh, hm, but I've not seen the overuse of cast that you have, josevalim , so I may be wrong
19:21 <Zarathu> ah, right
19:21 <Zarathu> separate controllers presents the problem of how to name them if they essentially do the same thing
19:21 <chrismccord> tristan__ : add me to the list of people that see beginners abuse cast to their detriment
19:21 <micmus> And separate controllers play nicely with 1.3 contexts where all your domain logic is out of the controller, so the controller only handles rendering
19:22 <Zarathu> in my particular case, i not only need to have an html index, but also a json api index, and also a csv download index
19:22 <tristan__> chrismccord: interesting
19:22 <josevalim> tristan__: why would you use cast? it doesn't fail if the process you are casting does not exist anymore
19:22 <micmus> json & csv or xml play nice together and atom render is great for this
19:22 <josevalim> it doesn't provide back-pressure
19:22 <chrismccord> tristan__ : I see folks treat it as async for rolfscale
19:22 <micmus> but html is a different beast in my experience
19:22 <tristan__> I'm used to running into code that overuses calls and ends up with a bunch of unncessary bottlenecks
19:22 <Zarathu> ah ok, so `render conn, :index, objects: objects` should do this automatically
19:23 <chrismccord> but there's no backpressure and I see apps with 100k's of messages for these servers in the msquee
19:23 <chrismccord> Zarathu yes exactly
19:23 <Zarathu> would I use pattern matching for this? e.g., `render("index.html"), do: ...; render("index.csv"), do...`
19:23 <Zarathu> err, def*
19:23 <josevalim> tristan__: right, then you measure, find those and improve it accordingly
19:23 <chrismccord> yes exactly
19:24 <Zarathu> gotcha! cool!
19:24 <tristan__> josevalim: when I don't care.
19:24 <chrismccord> Zarathu and your index.html can be an index.html.eex template if you'd like
19:24 <tristan__> if i can I'll do a call with spawn->gen_server:reply
19:24 <josevalim> sometimes you have bottlenecks and you still need replies
19:24 <Zarathu> yes, right
19:24 <Zarathu> I can't wait for phoenix 1.3 btw
19:24 <chrismccord> Zarathu : mostly baked if you arent' using channels
19:25 <Zarathu> what do you mean, baked
19:25 <chrismccord> channel api won't be changing, but I need to finalize some js bits for some internal changes
19:25 <ryanwinchester> i can't figure out why my cast_assoc isn't working :(
19:25 <chrismccord> Zarathu : baked as in "done", "ready", etc
19:25 <Zarathu> ah right. the context thing is pretty exciting
19:25 steffkes joined
19:25 whharris joined
19:25 <Zarathu> this app has like 30 models, controllers, views
19:25 steffkes joined
19:26 <ryanwinchester> time to take the dog for a walk, i guess
19:26 <Zarathu> chrismccord: hmm. is using "baked" like that a midwest thing?
19:26 Ven joined
19:27 pat_js joined
19:27 <chrismccord> Zarathu : I dont' think so, but who knows
19:28 <chrismccord> I think it's just a bad programmer metaphor thing
19:29 <Zarathu> haha
19:29 hbraun joined
19:29 griffinbyatt joined
19:32 m_m joined
19:32 Machete joined
19:35 MononcQc joined
19:37 DTZUZU joined
19:42 ekinmur joined
19:43 icecreamcohen joined
19:45 PaReeOhNos joined
19:46 roger_padactor joined
19:56 elgenie joined
20:00 <josevalim> I don't have anything else to add to that thread, so I have unsubscribed. now it is the second kind of problem :)
20:06 rkazak joined
20:08 sfaxon joined
20:09 <benwilson512> codestorm: yes in general
20:10 <benwilson512> but I'd say that's just a matter of having a lot of clients be javascript clients
20:10 <benwilson512> there's nothing in the spec nor community conventions saying you can't do snake case
20:11 <codestorm> if we wanted to use snake, would Absinthe need to be modified?
20:11 <benwilson512> no
20:12 <benwilson512> you just specify that you want the pass through adapter on Absinthe.plug
20:12 <benwilson512> and call it a day
20:12 <benwilson512> adapting external to internal formats is 100% pluggable, and has been since I think 1.0
20:13 <codestorm> oh, cool
20:13 <benwilson512> we ship with two adapters, LanguageConventions and PassThrough
20:13 <codestorm> oh, fantastic
20:14 PaReeOhNos joined
20:15 asabil joined
20:18 marr joined
20:18 meandi joined
20:21 cdg joined
20:24 wsieroci joined
20:26 refriedchicken joined
20:30 griffinbyatt joined
20:31 Gasher joined
20:38 rschmukler joined
20:39 russmatney joined
20:39 <rschmukler> Is there any way to automatically start an application in an umbrella project's mix.exs without it being an explicit dependency of any of the apps in the umbrella project?
20:41 wsieroci joined
20:42 rschmukl_ joined
20:43 wpcarro joined
20:45 Machete joined
20:50 rkazak joined
20:53 wpcarro joined
20:59 m_m joined
21:04 wpcarro joined
21:05 ejpcmac left
21:10 Machete joined
21:13 icecreamcohen joined
21:14 wpcarro joined
21:14 kronicdeth joined
21:14 hotpancakes joined
21:15 ikcerog joined
21:16 hotpancakes joined
21:17 josevalim joined
21:21 hashpuppy joined
21:23 kronicdeth joined
21:24 rkazak joined
21:24 Cohedrin joined
21:29 jleon joined
21:31 steffkes joined
21:31 steffkes joined
21:31 griffinbyatt joined
21:36 elgenie joined
21:36 wpcarro joined
21:37 akeating joined
21:41 wpcarro joined
21:42 Machete joined
21:50 MarioBranco joined
21:52 kronicdeth joined
21:52 rkazak joined
21:57 hakunin joined
21:59 bitmod joined
21:59 wpcarro joined
22:03 mk[] left
22:08 hakunin joined
22:10 ekmartin joined
22:10 wpcarro joined
22:11 LBRapid joined
22:12 johanw_ joined
22:12 guan_ joined
22:13 adulteratedjedi_ joined
22:14 jlouis joined
22:14 Quintasan_ joined
22:14 sulphur28 joined
22:15 myers_ joined
22:16 null__ joined
22:17 artmann_ joined
22:17 dimitarvp` joined
22:17 _2easy joined
22:17 _2easy joined
22:17 terinjokes joined
22:18 esainane joined
22:19 jaydoane joined
22:19 wsmoak joined
22:19 l1x joined
22:20 acetoxy joined
22:20 celyr joined
22:20 al-maisan joined
22:20 hakunin joined
22:20 micro joined
22:21 ahf joined
22:21 gen_ale_drinker joined
22:22 SouvikB joined
22:22 cmn joined
22:22 der_graf joined
22:23 Machete joined
22:25 ryanwinchester joined
22:25 jleon joined
22:25 niccs joined
22:26 mmcclure joined
22:26 barttenbrinke joined
22:26 marten joined
22:26 bikefighter joined
22:26 klaus_trainer joined
22:26 rschmukler joined
22:26 mroth joined
22:27 gyre007 joined
22:27 rodolfojcj joined
22:27 kronicdeth joined
22:27 CornishPasty joined
22:27 schaary_ joined
22:28 hakunin joined
22:30 alisdair joined
22:31 griffinbyatt joined
22:32 hakunin joined
22:32 hotpancakes joined
22:32 wpcarro joined
22:34 hotpanca_ joined
22:35 notdaniel joined
22:37 hotpancakes joined
22:40 hakunin joined
22:42 hotpancakes joined
22:43 elgenie joined
22:45 jleon joined
22:46 asabil joined
22:48 wpcarro joined
22:49 mika__ joined
22:51 <Radar> Could someone please decipher this error message for me? https://gist.github.com/radar/fa07b4fe3d4dcb9f0ca5af15be35067d
22:51 Ioyrie joined
22:52 <Radar> Pancake.Worker has a start_link/1 function
22:54 Machete joined
22:54 hakunin joined
22:56 <Ioyrie> if only it has an add_butter/1 function tooo
23:01 notdaniel joined
23:04 notdaniel joined
23:06 jleon joined
23:10 hotpancakes joined
23:12 <micmus> Radar: the supervisor is calling start_link/0
23:18 wpcarro joined
23:21 <Radar> micmus: Aha! Thank you :)
23:21 jleon joined
23:23 hotpancakes joined
23:26 hotpancakes joined
23:29 wpcarro joined
23:30 cschneid_ joined
23:30 mozzarella joined
23:31 steffkes joined
23:31 steffkes joined
23:31 mika__ joined
23:33 jleon joined
23:36 hotpancakes joined
23:36 <ryanwinchester> if i wanted to split my seeds into multiple files, but still run them all from the main seeds.exs file, what would I have to do?
23:36 <ryanwinchester> would simply requiring them be enough?
23:40 wpcarro joined
23:42 jimmyrcom joined
23:46 refriedchicken joined
23:47 hotpancakes joined
23:48 bambanx joined
23:49 kronicdeth joined
23:50 chrismccord joined
23:53 ivan joined
23:58 hotpancakes joined
23:58 Machete joined