#elixir-lang - 17 April 2019
« Back 1 day Forward 1 day »
[06:15:10] mdbm_: Nicd-, no:D I mean I am really new to this language, I don't know if that code would be fast to read
[06:15:55] serafeim: i think that the programming elixir book is considered very good. also the course by the same author (Dave Thomas: https://codestool.coding-gnome.com/courses/elixir-for-programmers) has been recommended for me in HN
[06:17:11] serafeim: sevenseacat which is better for an experienced programmer ? (i'm highly experienced in java, python and a some lisp/scheme)
[06:17:44] serafeim: i read the "Functional programming with Elixir" book but found it geared toward beginners
[06:19:13] serafeim: hm i think it's closer to introducing functional programming using elixir as a vehicle
[06:19:41] mdbm_: Nicd-, but he makes a 'printer', which uses IO.puts, and then a 'speaker' which uses the say function. wth... isn't that redundant? why do IO.puts AND say
[06:19:51] serafeim: I don't like that approach very much; i don't think elixir is good for a first introduction to functional programming. better to start with scheme for me.
[06:23:27] serafeim: also, concerning the approachibility of Scheme you can download Racket (which is well known) and use the Scheme dialect
[06:23:54] mdbm_: Nicd-, it says it speaks its argument... but I thought it was figurative to say print
[06:23:57] sevenseacat: I started reading it, and the very first concept it introduces is lamba calculus, i was like what
[06:24:48] serafeim: I never tried Haskell; it was offered in the "programming languages II" in the university but I avoided that course
[06:25:51] Nicd-: it's like using C++ as first programming language as we did in university. when people get two screenfuls of compile errors for something simple, they get discouraged and think all languages are as unhelpful or unforgiving. many dropped out due to that. nowadays they use Python (wondering how that goes but it feels better to me)
[06:47:24] serafeim: are you using some IDE to write elixir ? do you believe that vim would be fine ?
[07:08:15] OliverMT: I havent seen F# in the wild yet, and I work as a cloud solution architect for Microsoft :P
[07:42:43] Nicd-: I watched a presentation about PureScript once, the learning curve was like this: ______|
[07:45:01] dysfun: it's been fascinating having input from someone like that to my latest purescript library
[08:50:27] Linuus: General programming question, when changing an exception message, would you consider that a breaking change in Semver?
[09:37:48] CornishPasty: Is anyone aware of a debug bar for phoenix, similar to the one in Symfony? I'm sure I've seen one before, but I can't find it now
[09:47:39] serafeim: i really hate such projects; usually you lose a lot of time to integrate it and then you understand that it doesn't work with your version
[09:50:08] Linuus: I understand what you mean with dead projects but I don't like people complaining on stuff other people has made for free in their spare time.
[11:13:18] serafeim: does anybody use sqlite3 in his dev env or i should bite the bullet and add postgres ?
[11:16:15] Linuus: Serafeim: What are you trying to achieve? Do you want the DB structure or the data?
[11:17:16] Linuus: Sure it can, but it's always best to use the same as in prod because there are differences between sqlie and postgres which you will only find out in prod.
[11:19:44] Linuus: mdbm_: It'd not a convention in Elixir but nothing prohibits you from doing that.
[11:21:18] Linuus: mdbm_: Ok, it's not a convention in the community. So, if you want to align your code with the rest of the world, don't use underscore.
[11:22:09] mdbm_: Serafeim, https://github.com/christopheradams/elixir_style_guide if I search on defp, I see no _
[11:53:00] serafeim: can somebody help me with ecto? I am reading this part: https://hexdocs.pm/phoenix/ecto.html#data-persistence
[11:53:37] serafeim: this works fine even though *in the previous paragraph) I've declared that user must have the name, bio and email as required
[11:54:26] serafeim: also, since I have declared these fields as required *why* thy are nullable in the database ?
[12:06:55] serafeim: I mean i'll change my schema by adding a field and the corresponding migration will be automagically generated so i;ll only need to run it (and not fill it)
[12:08:46] ericmj: I prefer to build them separately because there is not a 1-to-1 mapping between your schema and database
[12:23:32] serafeim: I am trying the following migration: alter table(:users) do modify :name, null: false end
[12:24:29] serafeim: i get a funny error like this: [serafeim@serafeim-pc playground]$ mix ecto.migrate[info] == Running 20190417121849 Playground.Repo.Migrations.MakeUserNameRequired.change/0 forward** (FunctionClauseError) no function clause matching in Ecto.Migration.validate_type!/1
[12:24:35] ericmj: that function takes 3 arguments, https://hexdocs.pm/ecto_sql/Ecto.Migration.html#modify/3
[12:32:00] serafeim: yes it works when I change it to alter table(:users) do modify :name, :string, null: false end
[14:25:38] kapil____: Hello i am using arch linux. can i deploy phoenix app made with distrilly in arch linux in ubuntu?
[14:28:52] Nicd-: use Timex or lau/calendar to parse it into a DateTime struct (there are no objects in Elixir)
[14:29:22] Nicd-: Elixir has https://hexdocs.pm/elixir/DateTime.html#from_iso8601/2 builtin but it may not accept that format
[14:45:34] hypercore: kapil____: the distillery website has some good guides for building and deploying with docker -> https://hexdocs.pm/distillery/guides/building_in_docker.html, https://hexdocs.pm/distillery/guides/working_with_docker.html
[15:20:55] drewolson: is there anything i can do to prevent having to order my gen stage producer/consumers in "graph order" when starting them from a supervisor?
[15:51:51] josevalim: drewolson: i am not sure what you are asking, but everything you say makes sense :D
[15:53:43] drewolson: josevalim: yep, was just curious if somehow the supervisor could be smart and see the dependency graph between the gen stages
[16:05:35] starbelly: Or better worded for others... supervisors IMO should be as dumb as rocks, they should know how to supervise and nothing more for great reliability.
[20:07:06] grg: so I'm working on validation that allows for a max number stored on a group object, that restricts the total true count for a boolean on item objects in that group. Does it make sense to have this validation in the changeset? Where the validation I'm thinking of requires a read of the group & associated items?
[20:09:21] benwilson512: grg: regardless though, ideally the data would be read ahead of time and then passed to the changeset
[20:26:48] grg: does it make sense to place this validation in the create / update mutations (given use of absinthe)?
[20:27:39] grg: and / or, is this more of a use case that should focus on db level validation somehow?
[22:20:55] wyzzard: I want to create a new user to run my application but I'm unsure why I'm getting
[22:21:12] wyzzard: Anyone with Docker + Distillery knowledge willing to give me a hand would be appreciated
[22:21:19] wyzzard: From my understanding this should transfer ownership to the "app" user who should be able to run those commands. I don't quite know why that isn't the case
[22:28:39] tristanm_: I recently had to do a number of fixes to relx's run script to get it to work smoothly when a container was run as a random user
[22:29:13] tristanm_: that was one of the ones in the relx script. that and it was creating ~/.erlang.cookie a number of times it didn't need to