1. 1

    Question: If gen_event ran handlers concurrently by default, how would you go about running handlers sequentially?

    I don’t think it is a pretty common use case. However I very frequently need something like a gen_event that handles things concurrently and that doesn’t crash all the handlers if one handler crash. It is really easy to implement a sequential gen_event using a gen_server. Implementing each time something like José Valim wrote on his post is more difficult and error prone.

    1. 1

      Unless a handler calls erlang:exit, it’s unlikely that the event manager will crash if a handler does. As I understand it, the default behavior is to remove (silently by default, or sending a message in the case of add_sup_handler) the failing handler and carry on.

      That said, I think you have a point in that it’s reasonably simple to turn a gen_server into something almost identical to a gen_event, and avoid gen_event’s fiddly bits. My main point in the article is that I think that running handlers sequentially is a good default because of the affordances it offers developers.

      I guess at this point I’m torn between whether or not it is better to have a design that is less broadly useful, but more flexible, versus one that is widely usable, but inflexible. Given this blog post, I’m currently leaning towards more flexible.

      Thanks for reading!

    1. 2

      I would not recommend to store any password “in the cloud” (dropbox, password managers), as it is heavily targeted to surveillance and attacks.

      An advantage of git is that you can use it over SSH (again, I do not against GitHub for passwords).

      Why not keeping the passwords on a usb flash drive at your keyring (the physical one)? You have then all your keys in a safe place with no leak ever possible while you are not at the moment where you want to log in. Then even if you loose your laptop, you do not loose any precious password.

      Putting them on an encrypted file/drive partition might also be a more reasonable choice as long as you know where your computer is going.

      1. 3

        i agree with what you wrote but how do you use thoses passwords in an iphone/android/ipad/tablet?

        1. 1

          That is a big flaw, you can’t you are right.

      1. 9

        pass. I don’t understand the syncing issues. If you write code and use git, then syncing passwords works exactly the same as syncing code. I even have it working on my phone.

        1. 3

          how do you add or update passwords in your phone or ipad? i travel and i don’t always have access to a computer.

          1. 3

            That isn’t actually in my normal usage pattern, but I just tried it and it works. The app lets me add entries to my pass database, and then I can push to my git remote through the GUI. What happens if a merge conflict arises isn’t clear though. :-)

          2. 2

            I also use pass, but only have it locally on one machine. Until now I’ve been relying on Chrome’s password sync feature if I wanted a password on my phone too.

            My setup isn’t ideal, so if you don’t mind elaborating on yours, please would you give more details?

            1. 4

              Oh sure! I have an Android phone. All I did was install OpenKeychain and the unofficial Android Password Store app. I then imported my key into OpenKeychain and setup Password Store on my phone to use it. All Password Store needs is to pull from your git repo containing passwords. It only does this when you tell it to, so it keeps a local copy on your phone and you can sync whenever.

              1. 3

                Fantastic info; thank you very much. :-)

          1. 7

            It’s really unfortunate that the idea of a live coding remains niche, and most programmers haven’t had exposure to this style of development. Working in an environment where you can inspect and change any aspect of the system at runtime is the most satisfying coding experience in my opinion.

            1. 7

              Coding hackers tell me they want to understand, change, and improve on anything they can get their hands on. The live coding systems let them do that to their whole, running system. It just seems like the two are a natural fit. It makes it so much stranger to me to see such people use tools that limit them so much.

              1. 5

                It’s probably why people have tended to think of Emacs, Common Lisp, and Smalltalk (and Forth?) in relation to the “quality without a name” described in Zen and the Art of Motorcycle Maintenance, or the living quality of buildings described by Christopher Alexander.

                1. 4

                  I would also add Erlang to that list, but that might be controversial.

                  1. 4

                    I mostly agree. It doesn’t have the same deep metaprogramming aspect, but the actor model is a much cooler form of concurrency than the languages I listed, and things like supervision hierarchies have quite a strong sense of being “alive.”

                    1. 2

                      The tracing capabilities and the ability what process is doing what and which messages are being received is quite impressive.

                    2. 2

                      Yeah, I don’t know if it fits since I don’t use it. I will say that making distributed, concurrent systems easier and more robust by design with ability to update running systems makes it pretty close to the idea. It’s kind of in its own category in my mind where the LISP’s were focused on max flexibility where things like Erlang or Ada are focused on max reliability. Erlang improved on things like Ada in its category by being more high-level, distributed, the updates, etc.

                      Now, it might be interesting to combine the two. I swore someone… (checks bookmarks) Oh yeah, it was LISP-Flavored Erlang. I can’t evaluate further about whether it truly has benefits of typical LISP workflow and Erlang since I don’t know Erlang or LFE. Looked really awesome conceptually when I found it. Anyone else chime in?

                  2. 3

                    Pervasively dynamic environments are a two-edged sword: with great power comes great responsibility. It’s trivial to render a Smalltalk image completely unusable with something as simple as false become: true. PicoLisp has similar capabilities. Most Forths do too. There’s something to be said for isolating and stabilizing some basic parts of the system: such limitations give us a margin of safety!

                1. 2

                  Congrats! Is anybody using DragonFly on production? Why do you choose it over FreeBSD or OpenBSD?

                  1. 3

                    Because HAMMER. OpenBSD doesn’t have an equivalent filesystem option. FreeBSD has ZFS, which is very nice, but it’s also huge. HAMMER by comparison is a simple implementation of a “modern” (snapshoting, checksuming, deduping) filesystem.

                    1. 1

                      I have never used HAMMER. Apart from having a simpler implementation (that is really nice and difficult to do), is there any big advange of using HAMMER over ZFS? Apart from HAMMER there is any other feature that you recommend us checking out?

                  1. 7

                    I have been using OpenBSD at my laptop for the last year and a half. The only issue I have is that Firefox is way slower than in Void Linux or Debian. But apart from that it works perfectly fine.

                    1. 5

                      Might be faster in 6.3 which ships ff quantum.

                    1. 1

                      I recommend that you write the scaffolding generator in golang or rust. Golang easily compiles and generates a binary for a lot of platforms and it has good libraries for creating CLI tools. I wrote one in golang: https://github.com/unbalancedparentheses/gut/blob/master/gut.go

                      1. 1

                        Thanks, I’ll check it out

                      1. 1

                        I have asked to join.

                        1. 2

                          Great work!

                          1. 4

                            So far, only two:

                            1. “The Intelligent Investor” - Benjamin Graham (revised edition)
                            2. “Social Engineering: The Art of Human Hacking” - Christopher Hadnagy
                            1. 3

                              I have The Intelligent Investor on my bookshelf right now. Its been giving me the evil eye for a year now. Thanks for the reminder! ;)

                              1. 4

                                The Intelligent Investor”

                                Great book. If you like I recommend that you check “A Wealth of Common Sense: Why Simplicity Trumps Complexity in Any Investment Plan” and the great Financial markets coursera course.

                                1. 5

                                  Thanks for the coursera suggestion! Is this the specific course you are referring to? https://www.coursera.org/learn/financial-markets-global

                                  1. 3

                                    Exactly. Shiller, the teacher, is a nobel laureate. The course is really good. It can get a little bit dense specially in the first weeks, but do it completely, it gets better with each week.

                            1. 4

                              The value of blockchains isn’t the currency systems implemented on them- it’s the general distributed ledger. There are useful problems that can be solved by storing information in public, validated with proof-of-work, with conflicts in history being resolved by consensus.

                              Coins are the carnival barker trying to push traffic into the system. Do the grueling proof-of work, and we give you an entry in the ledger that says you own some coins. Get in quick though (at least with Bitcoin), because there aren’t very many. But that means the value can only go up! They’ll get rarer over time!

                              1. 1

                                Yes the inflation model of btc is fundamentally unsustainable. Also it’s a bit unfortunate that the proof-of-work chosen is not work that benefits humanity in any way.

                                1. 1

                                  The proof-of-work model chosen by Bitcoin is the most straightforward, and arguably, the most resistant to Sybil nodes and “cheating”. It is, after all, consciously modelled after physical mining, which is also arguably wasted work - dig up X tons of ore to extract Y kilos of precious metal.

                                2. 1

                                  Do you have any good reading that you can recommend about cryptocurrencies?

                                1. 21

                                  Here’s a couple of quick tips:

                                  • Even though you got some saved money: Make the tickets cost-covering. Take your fixed cost (speaker travel, video recording, venue, lunch) and divide them in per-head and one-off costs. Charge so much that you cover the cost, plus maybe 5% for disaster cases.
                                  • Try to make a small profit. Why? It makes you sleep easy and allows you to use the saved money for the next one.
                                  • Think about accessibility (wheelchair-accessibility, etc.) now. It’s easy to do upfront and hard to do later. Also, people in need of support need to know early on. Document what you have, give an email address for those that have questions. Communicate that. Example: http://zurich.rustfest.eu/accessibility (just strike off the list what you don’t have / can’t provide, see this as a list of options).
                                  • Work with social media and understand that you have a global audience. For example, if you have an announcement, tweet it 3 times to different times. Most people don’t read Facebook/Twitter all day, which means they will probably miss 1 or 2 announcements.
                                  • Don’t invite too many speakers. Invited speakers are cozy and you probably know what you get. But, the CFP often contains nice things from fresh people.
                                  • Also speakers: gamble and be willing to have a dud. Some of the best talks on my conferences were from unknown newcomers. A certain Steve Klabnik gave their first keynote on one of our conferences because we gambled.
                                  • For these reasons, have an semi-anonymous review. We’ve had cases where regular and known speakers put very lackluster proposals in, but we’re sure that we would have been tempted to take them anyways. Semi-Anonymous is the form where the first round of proposal rating just rates the proposal, not the speaker. The lower 50% are cut off. The second round is just as usual, with speaker identities revealed.
                                  • It’s fine to pick someone you like. It’s your conference. Just be aware that a CFP is a way to ensure you look in corners outside your usual circles.
                                  • For that reason, advertise your CFP. A LOT. Try to spread it outside of your circles.
                                  • Alcohol is the most useless budget point on the ticket price. Kick it, just charge less. “Drinks included” is usually “drinks pre-paid and if you don’t drink, you’re cross-financing others”. Obviously, non-alcoholic things, especially water should always be around. People that drink have no problem with just buying at the bar. Go to a place where that is feasible.
                                  • There’s a substantial group of people that is not into loud partying. Make sure your party places have quiet corners.
                                  • Quiet rooms (a room where absolutely no talking is allowed) are easy to make and people love it. After 4 hours of chatting and talks, people enjoy being silent for a while. Also, they make an easy social contract, which for example allows speakers to just go in there after a talk.

                                  This is just what quickly came to my mind…

                                  1. 1

                                    All I can say is THANKS

                                  1. 10

                                    I’m one of the organizers of !!Con in New York City, an annual programming conference about to be in its fifth year. if you’re interested, I’d be happy to answer any questions you have either here in the comments, or DM me and we can set up a time to chat. :)

                                    1. 1

                                      Thanks! I will reach you as soon as I finish working. I am a big fan of the !!Con, I hope you can upload the 2017 videos :)!

                                      1. 3

                                        Thanks for the reminder, we’ve had a PR open for that for a long time that you just prompted me to merge :|

                                        http://bangbangcon.com/recordings.html

                                    1. 1

                                      There’s racism/inequality in government surveillance too!

                                      We must fight for our right to be surveilled just as much as minorities are!

                                      Surely, governments will find it in their hearts to graciously grant us that right. Write to your congressperson today, and ask for more surveillance!

                                      1. 3

                                        I don’t think the objective of the article is to point out that we should be surveilled as much as minorities are…

                                        1. 3

                                          I wasn’t being serious?

                                          The author seems confused. He’s speaking governmentese, discussing what the US government’s laws say about surveillance and related court precedents, seemingly oblivious to the fact that the government will surveil whatever the fuck it pleases, no matter what its own laws say.

                                          The Fourth Amendment, among our strongest safeguards against police overreach

                                          Despite all the police abuse we’ve all seen, he still thinks the fourth amendment is a “safeguard”, like it’s magic text that somehow prevents police thugs from engaging in thuggery?

                                          And so on.. the article isn’t much more than a virtue-signalling fluff piece, and a testament to the author’s confusion about reality.

                                        2. 1

                                          I don’t think that your troll comments will convince anyone to shift to your anti-government stance, so maybe just don’t write them?

                                          I’ve seen quite a few of your comments now, and they hammer the same point rather monotonously, suggesting that your position lacks depth and nuance. Perhaps you should spend some time considering how your no-government utopia (or whatever it is you want to see) would work in practice? You might be surprised by your conclusions, or at least you’ll have more convincing arguments.

                                          1. 1

                                            It’s funny how you accuse me of trolling, with a comment that’s indistinguishable from trolling :P

                                            your position lacks depth and nuance

                                            You’re skirting around being on to something there. For example, there isn’t any nuance to extortion being immoral, or text on a piece of parchment not having magical powers: https://www.youtube.com/watch?v=ngpsJKQR_ZE&t=8

                                            Perhaps you should spend some time considering

                                            Perhaps you should? https://www.youtube.com/watch?v=BNIgztvyU2U

                                            Even those two videos are more than enough to make any sane person agree with me, so I’ll just stop here.

                                            1. 4

                                              I think you’re making two assumptions:

                                              • Lobste.rs is a good place to share your outrage
                                              • People here have never heard about anarchism or abuse of government powers or anything related.

                                              I disagree with both of these assumptions. I think most people here are extremely well informed, and I also think most people prefer this site to be an outrage-free zone.

                                              Now, I would like to read an intelligent argument for how anarchy would work in practice with 7.5 billion people on the planet, and particularly how you would transition to it from the current world order. That would be a worthwhile thing you could write. The videos you linked don’t even begin to address any of it.

                                              1. 0

                                                how anarchy would work in practice with 7.5 billion people on the planet, and particularly how you would transition to it from the current world order

                                                If chattel slavery were abolished, who would pick the cotton? There could be severe disruptions to supply chains, companies might go bankrupt and people might lose their jobs!

                                                Also, how well is being enslaved by governments “working” for you?

                                                I think most people here are extremely well informed, and I also think most people prefer this site to be an outrage-free zone.

                                                Reality doesn’t just go away if you ignore it hard enough, you know? That’s basically what you’re suggesting with the “outrage-free zone”.

                                                So are almost all psychopaths resigned to a fate of being enslaved for ever by governments? Or why is this site so free of outrage in general?

                                        1. 1

                                          I am working in different open source projects with other members of my small company:

                                          • We are writting an erlang’s database client wrapper that reconnects to the database after a netsplit/database restart/etc.
                                          • We are working on a simple drop in WebRTC server written in erlang. Audio/Video calls are really easy to implement client side using WebRTC. Howeve it is not that easy as it seems to implement server side. You need to implement a STUN/TURN server apart from the signaling server. We are trying to package everything so that you clone it, run it or even download a docker image and you can implement your own WebRTC server for your iOS/Android app or webpage.
                                          • We started working on a small Erlang dependency that automatically joins erlang nodes to the same cluster if they are in the same subnet.
                                          1. 2

                                            This is mostly about their laptops and tablets. I was hoping for more about their more exotic stuff: Kinect, HoloLens, etc.

                                            1. 1

                                              So did I, but anyways I found it interesting.

                                            1. 1

                                              Can I ask what the business model of lambdaclass is or will be?

                                              1. 1

                                                From this blog post:

                                                LambdaClass, a Buenos Aires-based software consultant founded a while ago by some colleagues and schoolmates. LambdaClass has a special interest in distributed systems, and while it’s not exclusively an Erlang shop, most of its projects are implemented in BEAM languages.

                                                1. 2

                                                  That doesn’t seem like a business model. It sounds more like an erlang hobby club.

                                                  edit: apologies, I glazed over the word consultant there.

                                                  1. 1

                                                    The difference between a business and a hobby club is profit. We do have fun but we exists because we have clients.

                                                    Developers are expensive and in many cases they don’t have the experience or knowledge needed. In a few particular areas we have experience and knowledge.

                                                    1. 2

                                                      I was not implying it isn’t a business, just that I didn’t understand it. I missed the part it is a consultancy. Thank you for clarifying. I absolutely see the value in building software stack so you have a pool of tools to draw from. I just don’t really see the benefit in running something indefinitely for free.

                                                      edit: eh, im just digging myself into a hole. Apologies for a stupid comment caused by poor reading.

                                                      1. 1

                                                        You do have a valid point: for the time being we are more like a hobby club, one that sells services. We choose what we do and how over earning more. If we grow bigger we will need to be more similar to other companies. So that you know we are only 5 devs at the moment. I have to write a few lines for our landing (3 years without a landing page is way too much) and your comments made me realize we need to simplify our message. Thanks!

                                                        1. 1

                                                          It actually seems like a great place. A lot of what you guys have written resonates well with me.

                                              1. 3

                                                I think the title is missing a “know” between customers and about.

                                                1. 1

                                                  Thanks, I thought it was correct without the know.

                                                  1. 3

                                                    Oh sorry, did not see it.

                                                    1. 4

                                                      Good thing its worth the repost!

                                                  1. 0

                                                    A majority of catalan people wants to hold a referendum for independence, with a significant share of the population supporting independence.

                                                    Richest region in Spain wants to stop paying taxes to the central government? Hold my mate, I’m first going to get Lombardy’s independence, then separate the individual provinces inside it after which I’ll convince people to go back to city-states. Smallest taxes ever!

                                                    1. 13

                                                      Basque people leaving in Euskadi pay taxes directly to their autonomous government and not to the central government. On the other hand, it is pretty shallow to think that Catalunya’s fight for independence is a fight for paying less taxes.

                                                      1. 2

                                                        Basque people leaving in Euskadi pay taxes directly to their autonomous government and not to the central government.

                                                        From https://en.wikipedia.org/wiki/Autonomous_communities_of_Spain#Degree_of_financial_autonomy :

                                                        the central government is still charge of levying and collecting most taxes, which it then redistributes to the autonomous communities with the aim of producing “fiscal equalization”. This applies to all communities, with the exception of the Basque Country and Navarre.

                                                        So the biggest of the richest regions wants to also keep it all to itself, just like those two small ones. The poor? Let them eat cake!

                                                        it is pretty shallow to think that Catalunya’s fight for independence is a fight for paying less taxes

                                                        They already have everything else: https://en.wikipedia.org/wiki/Generalitat_de_Catalunya#Autonomous_system_of_government

                                                        1. 5

                                                          In the three provincial councils of Euskadi (Bizkaia, Gipuzkoa, Araba) and in Navarra (Nafarroa) you pay taxes to the local governement and the local government discusses with the central government how much money has to go the central government. This is a right that Spain gave to a part of the Basques with the constitution of 1978. For the nationalist basque right and conservative party this was a victory. For the left and nationalist basques this was only a carrot that Spain gave to them while using the stick against them at the same time. In Catalunya, and the rest of Spain, you pay your taxes to the central government and then the central government decides how much money returns to Catalunya.

                                                          Anyways, the problem for Catalans and Basques with Spain is not only a money or tax problem. I would say that is the least of the problems. Paises Catalans, Euskal Herria (Basque Country) and many other kingdoms that existed in the Iberian Peninsula where invaded by what is now the Kingdom of Spanish (it is the official name of Spain). What is happening now is not different from what has been happening for centuries:

                                                          You say that they have already everything else. I don’t think so but I think that is a decision that the Catalans and Basque have to do. What I can assure you is that if a “problem” has existed for centuries, then probably it is not only a tax problem.

                                                          1. 1

                                                            that is a decision that the Catalans and Basque have to do

                                                            Yeah, let’s let the rich decide whether they want to pay taxes. What can possibly go wrong?

                                                          2. 3

                                                            The poor? Let them eat cake!

                                                            Right, because justice from Paul’s perspective is that Peter gets robbed and his money handed to Paul.

                                                            Justice from Peter’s perspective might involve not getting robbed.

                                                            1. 1

                                                              Justice from Peter’s perspective might involve not getting robbed.

                                                              But only after he managed to get an unusually big share of those limited resources, right?

                                                        2. 3

                                                          I can’t tell what you’re trying to say, but you do understand that no one wants to pay taxes, right? Not even you. Nnnnnope, not even if you claim otherwise in a misguided attempt at virtue-signalling.

                                                          We all pay taxes purely because we’re forced to.

                                                          So would it be so wrong of Catalonians to want to have less of their income confiscated and sprinkled all over Spain? What prevents other regions from being just as wealthy as Catalonia?

                                                          1. 1

                                                            you do understand that no one wants to pay taxes, right?

                                                            Yes, of course. Do you understand why taxes are necessary even if we don’t want to pay them?

                                                            So would it be so wrong of Catalonians to want to have less of their income confiscated and sprinkled all over Spain?

                                                            Of course it would. The rich wanting to get richer is why the poor go hungry while we throw away food surpluses and while we plan to reduced the cultivated areas in order to keep the grain prices high: http://www.producer.com/2017/05/world-needs-to-slash-crop-acres-to-cut-grain-surplus/

                                                            It’s either voluntary solidarity and very modest wealth redistribution or 1789 all over again. Pick your poison.

                                                            What prevents other regions from being just as wealthy as Catalonia?

                                                            Fewer natural resources, past inequalities, less attention from the people in power, fewer investments by the central government, etc.

                                                            1. 2

                                                              Do you understand why taxes are necessary even if we don’t want to pay them?

                                                              The Spanish government arranges bullfights using tax money. Well spent?

                                                              Also some might wonder if there could be better cures for poverty than sponsoring it, but that’s a certain downvote or a few.

                                                              1. [Comment from banned user removed]

                                                          2. 2

                                                            Some people prefer the idea of city-states, and a smaller state does not necessarily mean smaller taxes, they have less sources of money so it would ensue that they would take more from those sources.

                                                            1. 2

                                                              Some people prefer the idea of city-states, and a smaller state does not necessarily mean smaller taxes, they have less sources of money so it would ensue that they would take more from those sources.

                                                              What you don’t know is that taxes from richer regions are used to finance poorer regions in a redistribution system controlled by the central government.

                                                              The plan for autonomous/independent rich regions is to stop contributing to a central government that gives them back in investments less than they contributed in taxes. Once they no longer need to pay for those terrible poor people, they can cut their own taxes as they like.

                                                              It’s economical inequality at the regional level - the rich get richer, the poor get poorer and we wax poetic about cryptographic solutions for illegal referendums…

                                                              1. 2

                                                                We practice redistribution in Canada, so I do know about it. I’m not convinced that independence movements are all about the rich wanting to stop redistribution of ressources, it could simply be about wanting to have more localised redistribution, why send money to another part of the country when you still have areas in your city that struggle with poverty?

                                                                It could also be about renegotiating that redistribution. for instance, I’ve always felt that the quebec independence movement was always about having more agency on how the provinces ressources are used.

                                                                1. 0

                                                                  it could simply be about wanting to have more localised redistribution

                                                                  AKA: let my left hand pay taxes to my right hand.

                                                                  why send money to another part of the country when you still have areas in your city that struggle with poverty?

                                                                  Why get rid of that poverty when it’s the only excuse for keeping more money locally? https://en.wikipedia.org/wiki/Perverse_incentive

                                                                  1. 4

                                                                    As funny as many of the examples in that link were, I’m not sure it applies itself to this situation.

                                                                    This argument is pointless if you refuse to aknowledge any other intention than short term financial gain on their part.