From zxq9@REDACTED Sat Jul 1 06:47:58 2017 From: zxq9@REDACTED (zxq9) Date: Sat, 01 Jul 2017 13:47:58 +0900 Subject: [erlang-questions] Any way to force PAX/POSIX TAR format? Message-ID: <1607295.mzUMeFL23l@changa> According to the docs ( http://erlang.org/doc/man/erl_tar.html ) erl_tar produces USTAR format files by default, but switches to PAX (POSIX 1003.1-2001) headers when a USTAR limitation is reached (long filenames, unicode metadata, large UID/GID values, etc.). Is there any option to force erl_tar to always produce PAX formatted tar files? (I could trigger it by arbitrarily including some USTAR limitation, but that's hackish enough to be discouraging.) -Craig From erlang@REDACTED Sat Jul 1 16:37:12 2017 From: erlang@REDACTED (Joe Armstrong) Date: Sat, 1 Jul 2017 16:37:12 +0200 Subject: [erlang-questions] wxErlang question 1 Message-ID: I have some wxErlang questions: I have created a wxFrame and I want to get some messages sent to me when things happen. Looking in the examples in the erlang distribution I can find lines of code like (for example) wxFrame:connect(Frame, close_window), and wxFrame:connect(Frame, command_menu_selected, [{callback, Add}, {id, 747}]), Once these calls have been make the process creating the frame is sent close_window and command_menu_selected messages. My questions are "how can I find all the possible values of the 2'nd argument to wxFrame:connect - and "what is the 3'rd argument" and what is the meaning of the data in the messages. I did find a method for answering the first question (which might be correct) 1) go to http://docs.wxwidgets.org/trunk/classwx_frame.html and look up section called "Event emitted by this class" this has events called EV_CLOSE(func) EV_ICONIZE(func) and so on the erlang name of these events appears to be 'close' and 'iconize' 2) If the event you want is not in this list go to the top of the page Here we see that wxFrame inherits the properties of wxTopLevelWindow. Click on this leads to http://docs.wxwidgets.org/trunk/classwx_top_level_window.html and we can check which events it omits Is this how to find the names of the events or is there a better way? What about my questions 2 and 3? Do I have to swallow a book on wxWidgets to learn how to program wxErlang? - programming by reading the source and guessing what it means is not my favorite occupation. Cheers /Joe From erlang@REDACTED Sat Jul 1 17:19:50 2017 From: erlang@REDACTED (Joe Armstrong) Date: Sat, 1 Jul 2017 17:19:50 +0200 Subject: [erlang-questions] wxErlang question 2 Message-ID: Hello. I want to make a very simple graphics example in wxErlang. I want to make a "window" containing a rectangle I think this can be made from - a window containing - a canvas containing - a rectangle (or should the window contain a graphicsContext????) Nothing else - this should *not* use the wx_object behaviour but the raw wx interface. I want to understand one thing at a time and not use abstractions layered on top of the raw interfaces Cheers /Joe From eric.pailleau@REDACTED Sun Jul 2 10:41:45 2017 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Sun, 2 Jul 2017 10:41:45 +0200 Subject: [erlang-questions] wxErlang question 1 In-Reply-To: References: Message-ID: <58d3edda-dcd2-ff1e-8495-9e3339cd366e@wanadoo.fr> Le 01/07/2017 ? 16:37, Joe Armstrong a ?crit : > Do I have to swallow a book on wxWidgets to learn how to program > wxErlang? - programming by reading the source and guessing what it > means is not my favorite occupation. Hi Joe, did you tried wx:demo() ? It is a good cheat sheet every time I need to do some wx. However I admit it is always a pain when not doing wx regularly. Regards From erlang@REDACTED Sun Jul 2 11:30:29 2017 From: erlang@REDACTED (Joe Armstrong) Date: Sun, 2 Jul 2017 11:30:29 +0200 Subject: [erlang-questions] wxErlang question 1 In-Reply-To: <58d3edda-dcd2-ff1e-8495-9e3339cd366e@wanadoo.fr> References: <58d3edda-dcd2-ff1e-8495-9e3339cd366e@wanadoo.fr> Message-ID: On Sun, Jul 2, 2017 at 10:41 AM, PAILLEAU Eric wrote: > Le 01/07/2017 ? 16:37, Joe Armstrong a ?crit : >> >> Do I have to swallow a book on wxWidgets to learn how to program >> wxErlang? - programming by reading the source and guessing what it >> means is not my favorite occupation. > > > Hi Joe, > > did you tried wx:demo() ? Yes - but it's not much help. Let me explain why... If I start reading the code the first line in the first example that seems to do anything is: Panel = wxPanel:new(Parent, []) The documentation in wx.pdf says (at the top) says "See external documentation: wxPanel" So Panel = wxPanel:new creates a new Panel (I could have guessed that) indeed I did *guess* that - but what the heck is a Panel? Google google google ... in http://docs.wxwidgets.org/trunk/classwx_panel.html I found this text: A panel is a window on which controls are placed. It is usually placed within a frame. Its main feature over its parent class wxWindow is code for handling child windows and TAB traversal, which is implemented natively if possible (e.g. in wxGTK) or by wxWidgets itself otherwise. I'm not slightly wiser - you stick things in it - my coal is to create a "canvas" (A thing I can draw on) - now is what I call a canvas what wxWidgets calls a canvas or is it a GraphicsContext ?? And what is a Frame - and has the wxErlang Panel been placed in a frame it's been placed in "Parent" but what the heck is Parent. So here is my problem. The wxErlang documentation says "read the external documentation" and the external documentation and the external documentation is written in terms of Panels, Frames, Windows, Spacers, WobbleBongers and DingleSplodgers. I know diddly squat about Panels and Frames so this is not not much help... What I want to do is plot a rectangle in window - What I would like very much is a simple module - let's call this simple_graphics.erl My code would be like this: Win = simple_graphics:make_window(), Can = simple_graphics:add_canvas(Win) Rect = simple_graphics:add_object(Can, #{type=rect,x=>10,y=>20, ht => 200, width=>30, color=>red}) It should be possible to write simple_graphics.erl *using* wx widgets and the documentation. So far I've tried in vain for several hours. Can anybody write simple_graphics.erl???? The problem with things like wxErlang is that the people who implement wxErlang (Dan G - all praise be to his name) know what all these Panels and Frames are - to them it is "obvious" and thus needs no explanation. Bears of little brain and limited attention span (like me)would be deliriously happy if they could draw a rectangle in a window - and they would cry from the mountain top - "Hej, Ma I'm a programmer - I drew a rectangle in a window" Right now I'm waiting for enlightenment to strike me. (and reading up on the C++ xwidgets stuff - which is very definitely in the "you don't want to know" category. Cheers /Joe > > It is a good cheat sheet every time I need to do some wx. > However I admit it is always a pain when not doing wx regularly. > > Regards > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From paulperegud@REDACTED Sun Jul 2 11:56:37 2017 From: paulperegud@REDACTED (Paul Peregud) Date: Sun, 2 Jul 2017 11:56:37 +0200 Subject: [erlang-questions] Scaling SSL wrapped websockets - experiences Message-ID: I'm looking at SSL + websocket + cowboy scaling with regards to number of simultaneous connections. I'm interested in relationship between number of connections and latency of message delivery. Is there any data on performance of SSL implementation in BEAM? Best regards, Paul Peregud From eric.pailleau@REDACTED Sun Jul 2 11:57:12 2017 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Sun, 2 Jul 2017 11:57:12 +0200 Subject: [erlang-questions] wxErlang question 1 In-Reply-To: References: <58d3edda-dcd2-ff1e-8495-9e3339cd366e@wanadoo.fr> Message-ID: <4b92b4ae-a1e5-8db0-2e48-fbd52ce15364@wanadoo.fr> I sympathize :) . You could however look at wx:demo() , entry 'frame_utils' and try 'Open wxMiniFrame' . This is probably what is the closer to the need you have, if I understand well. But yes, I agree, there is a need for a simple documentation for newbies. I'm not enough specialist of wx to write simple thing on it unfortunately. Hope this can help anyway. Regards and good luck :) From erlang@REDACTED Sun Jul 2 12:21:37 2017 From: erlang@REDACTED (Joe Armstrong) Date: Sun, 2 Jul 2017 12:21:37 +0200 Subject: [erlang-questions] wxErlang question 1 In-Reply-To: <4b92b4ae-a1e5-8db0-2e48-fbd52ce15364@wanadoo.fr> References: <58d3edda-dcd2-ff1e-8495-9e3339cd366e@wanadoo.fr> <4b92b4ae-a1e5-8db0-2e48-fbd52ce15364@wanadoo.fr> Message-ID: The trouble is that the wx:demo examples are all written using the wx_object behaviour which conveniently hides all the interesting things. I guess I'll have to add some trace statements to wx_object to see what's *really* happening. Imagine you want to make an omelette and have no cookbook, all you have to do is unbreak the eggs and the rest is easy. wx:demo is the omelette and what I want is the cookbook :-) /Joe On Sun, Jul 2, 2017 at 11:57 AM, PAILLEAU Eric wrote: > > I sympathize :) . > > You could however look at wx:demo() , entry 'frame_utils' and try 'Open > wxMiniFrame' . > > This is probably what is the closer to the need you have, if I understand > well. > > But yes, I agree, there is a need for a simple documentation for newbies. > I'm not enough specialist of wx to write simple thing on it unfortunately. > > Hope this can help anyway. > Regards and good luck :) > > > From eric.pailleau@REDACTED Sun Jul 2 17:44:12 2017 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Sun, 2 Jul 2017 17:44:12 +0200 Subject: [erlang-questions] wxErlang question 1 In-Reply-To: References: <58d3edda-dcd2-ff1e-8495-9e3339cd366e@wanadoo.fr> <4b92b4ae-a1e5-8db0-2e48-fbd52ce15364@wanadoo.fr> Message-ID: Yes, there is a need to write a book on this, and lot of people possibly wanting to buy this. A market found. to stay with your food metaphor, a french joke, which expresses our 'wx distress'. "If I had mushrooms I could do a mushroom omelette but I don't have eggs either". Le 02/07/2017 ? 12:21, Joe Armstrong a ?crit : > The trouble is that the wx:demo examples are all written using the > wx_object behaviour > which conveniently hides all the interesting things. > > I guess I'll have to add some trace statements to wx_object to see > what's *really* happening. > > Imagine you want to make an omelette and have no cookbook, all you have to do is > unbreak the eggs and the rest is easy. > > wx:demo is the omelette and what I want is the cookbook :-) > > /Joe > > On Sun, Jul 2, 2017 at 11:57 AM, PAILLEAU Eric wrote: >> >> I sympathize :) . >> >> You could however look at wx:demo() , entry 'frame_utils' and try 'Open >> wxMiniFrame' . >> >> This is probably what is the closer to the need you have, if I understand >> well. >> >> But yes, I agree, there is a need for a simple documentation for newbies. >> I'm not enough specialist of wx to write simple thing on it unfortunately. >> >> Hope this can help anyway. >> Regards and good luck :) >> >> >> > From eric.pailleau@REDACTED Sun Jul 2 18:35:27 2017 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Sun, 2 Jul 2017 18:35:27 +0200 Subject: [erlang-questions] [ANN] geas 2.0.12 Message-ID: Hi, Geas 2.0.12 has been released. This is an update for Erlang 20.0 database and a bug fix. Geas is a tool that will detect the runnable official Erlang release window for your project, including dependancies, either from source code or beam files. Geas will tell you what are the offending functions in the beam/source files that reduce the available window. Geas will tell you if some beam files are compiled native. Geas is available as a module, erlang.mk and rebar 2/3 plugins. https://github.com/crownedgrouse/geas Cheers ! Eric From unix1@REDACTED Mon Jul 3 00:11:40 2017 From: unix1@REDACTED (Unix One) Date: Sun, 2 Jul 2017 22:11:40 +0000 Subject: [erlang-questions] simple cross platform graphics component In-Reply-To: References: Message-ID: On 06/26/2017 04:01 AM, Joe Armstrong wrote: > Any ideas here. > > I want a cross platform graphics widget. > > When started it should pop up a window and > listen for messages on port P > I should be able to connect to port P using UDP or TCP > > I send the widget messages encoded in something > (JSON, XML, OSC) > > The messages contain descriptions of graphics objects (preferably SVG) Since this is so specific, I wouldn't expect to find a ready made solution. But sounds like something I'd look into doing in Qt (maybe even in combination with QML); just because all the tools I'd need to build it should be readily available, wrapped in a nice package, heavily documented, with plenty of examples. I'd probably use qtcreator for Qt/QML programming. Qt4 SVG viewer: https://doc-snapshots.qt.io/4.8/painting-svgviewer.html Qt5 SVG viewer: http://doc.qt.io/qt-5/qtsvg-svgviewer-example.html Qt5 network examples: http://doc.qt.io/qt-5/examples-network.html Some 3rd party OSC efforts (not sure how useful they are): Qt4 OSC UDP client & server: https://github.com/kampfschlaefer/ofq Qt5 OSC: https://github.com/MugenSAS/osc-cpp-qt And Qt erlang efforts (in PoC stage): Qt5: https://github.com/kaos/QtErl QML: https://github.com/krant/eqml > The only program I have been able to find that does this is > inscore (http://inscore.sourceforge.net/) > > This uses OSC messages over UDP > > What I'd really like is an SVG over OSC over UDP widget (even JSON > over TCP would be OK - though less elegant) BTW, it looks like inscore also uses Qt. From ok@REDACTED Mon Jul 3 01:09:53 2017 From: ok@REDACTED (Richard A. O'Keefe) Date: Mon, 3 Jul 2017 11:09:53 +1200 Subject: [erlang-questions] wxErlang question 1 In-Reply-To: References: <58d3edda-dcd2-ff1e-8495-9e3339cd366e@wanadoo.fr> Message-ID: <3089AB1C-6BEB-4852-A7FD-D43727A040C3@cs.otago.ac.nz> For me, the gold standard remains Interlisp-D. Interlisp reference manual, 1983 edition (I have it beside me still), chapter 19 "Interlisp-D Display Facilities". 50 pages. Complete. Day 1: I've never written any graphics code in my life. Read the chapter. Day 2: read it again. Day 3: try some small examples. Day 5: multipane graphic debugger for the Prolog "microcode" complete. The nearest I've ever found is Tcl/Tk. Do the wxWindows tutorials help at all? For me, http://docs.wxwidgets.org/stable/overview_helloworld.html convinced me to stay away. From rick@REDACTED Mon Jul 3 02:07:52 2017 From: rick@REDACTED (Rick van Rein) Date: Mon, 03 Jul 2017 02:07:52 +0200 Subject: [erlang-questions] synchronous diameter_app:handle_request() -- how to spawn a worker? Message-ID: <59598AD8.3020300@openfortress.nl> Hi, I built authorisation code in Erlang, and am now trying to put Diameter in front of it. The code takes a fair bit of data and time, so I am preparing to split the data over nodes and redirect requests with Erlang's builtins, at the same time monitoring it for high availability. In diameter_app however, the handle_request() callback wants a final response. Deferring it with "noreply" is not mentioned as an option. Is there another way to initiate concurrency in handling requests? Thanks, -Rick From ok@REDACTED Mon Jul 3 04:41:05 2017 From: ok@REDACTED (Richard A. O'Keefe) Date: Mon, 3 Jul 2017 14:41:05 +1200 Subject: [erlang-questions] CACM June 2017, Kode Vicious Message-ID: The June 2017 issue of CACM turned up on the common-room table today, and as usual, I turned to Kode Vicious. This directed my attention to https://blog.acolyer.org/2016/10/06/simple-testing-can-prevent-most-critical-failures/ which summarises a 2014 Usenix paper I'd missed, https://www.usenix.org/system/files/conference/osdi14/osdi14-paper-yuan.pdf To summarise the summary: 92% of the catastrophic failures in distributed systems that Ding Yuan, Yu Luo, Xin Zhuang, Guilherme Renna Rodrigues, Xu Zhao, Yongle Zhang, Pranay U. Jain, and Michael Stumm studied "are the result of incorrect handling of nonfatal errors explicitly signalled in software." and from the paper: "We found the majority of catastrophic failures could easily have been prevented by performing simple testing on error handling code - the last line of defense ? even without an understanding of the software design." The second quote is basically talking about ensuring that test coverage covers exception handlers. Reading this made me realise just what a big deal "Let it Crash!" is. It is literally unthinkable for most programmers, due to the way we teach them using languages like Java. Nobody seems to be able to think "hey, if we get a lot of crashes due to 'sloppy' exception handling code, maybe we shouldn't *have* exception handlers." And it's sobering to realise that *I* would probably never have had this insight. I am just awed by the mind that could think such a thing. Viva Erlang! Semper floreat et crescat! (Another article in that issue, "Too Big NOT to Fail, Embrace failure so it does not embrace you", may also be of interest.) From erlang@REDACTED Mon Jul 3 10:24:49 2017 From: erlang@REDACTED (Joe Armstrong) Date: Mon, 3 Jul 2017 10:24:49 +0200 Subject: [erlang-questions] wxErlang question 1 In-Reply-To: <3089AB1C-6BEB-4852-A7FD-D43727A040C3@cs.otago.ac.nz> References: <58d3edda-dcd2-ff1e-8495-9e3339cd366e@wanadoo.fr> <3089AB1C-6BEB-4852-A7FD-D43727A040C3@cs.otago.ac.nz> Message-ID: On Mon, Jul 3, 2017 at 1:09 AM, Richard A. O'Keefe wrote: > For me, the gold standard remains Interlisp-D. > Interlisp reference manual, 1983 edition (I have it beside me > still), chapter 19 "Interlisp-D Display Facilities". > 50 pages. Complete. Day 1: I've never written any graphics > code in my life. Read the chapter. Day 2: read it again. > Day 3: try some small examples. Day 5: multipane graphic > debugger for the Prolog "microcode" complete. The nearest > I've ever found is Tcl/Tk. Tcl/Tk was (is) great (bar some rather strange quirks) > > Do the wxWindows tutorials help at all? > For me, http://docs.wxwidgets.org/stable/overview_helloworld.html > convinced me to stay away. The examples are horrible - an application seem to consist of a number specific classes which override or extends the behaviour of the standard classes. My problem here is that the standard classes do zillions of things and which methods must be overridden or extended to achieve somethings is unobvious. In my opinion use of callbacks and an event loop is the wrong way to do graphics - wxWidgets (and friends) seem to me to be extremely complex ways of hiding concurrency and replacing it with callbacks and an event loop. Every time I get locked into a modal window I think - "yet another concurrency failure" A typical example is a program that has a form and an account preferences page. When I'm filling in the form I need some detail that is the account preferences - but I can't access this until I've filled in the form - a typical concurrency error. I think it might be possible to tame wxErlang but right now I can't figure out how to even do simple things. /Joe > > From dangud@REDACTED Mon Jul 3 10:29:31 2017 From: dangud@REDACTED (Dan Gudmundsson) Date: Mon, 03 Jul 2017 08:29:31 +0000 Subject: [erlang-questions] wxErlang question 2 In-Reply-To: References: Message-ID: Q1: Where is connect and arguments descrbed in the event handler, which most of the classes inherits from: See wx.hrl and in http://erlang.org/doc/man/wxEvtHandler.html Then you will have to read which class sends which events.. Q2: The erlang documentation (or lack there of) does not have the intention of learning you how to write gui's with wxWidgets only the differences in the erlang wrapper. So you will have to look for that information elsewhere, I have tried to write examples and you can also look at the observer code for inspiration. I have not read the book it is old but may still be good, I'm not a wxWidgets expert I just wrote the erlang wrapper. On Sat, Jul 1, 2017 at 5:19 PM Joe Armstrong wrote: > Hello. > > I want to make a very simple graphics example in wxErlang > I want to make a "window" containing a rectangle > > Nothing else - this should *not* use the wx_object behaviour but the > raw wx interface. > > See below > I want to understand one thing at a time and not use abstractions layered > on top > of the raw interfaces > The abstraction cheats, wx have special code for helping with the abstraction, so it's useful but here is what you want in 40 lines: -module(joe). -export([run/0]). -include_lib("wx/include/wx.hrl"). run() -> %% Start wx application _ = wx:new(), %% Create the OS window (called frame) NoParent = wx:null(), % This is the top level window, we have no parent NoId = ?wxID_ANY, % We can set an id for every widget, % we don't need a specific id here Frame = wxFrame:new(NoParent, NoId, "Hello Joe"), %% Create a widget as background and drawing area belonging to the frame. Panel = wxPanel:new(Frame), White = {255,255,255}, wxWindow:setBackgroundColour(Panel, White), %% Create a sizer, the sizer handles widgets placement and size Sizer = wxBoxSizer:new(?wxVERTICAL), wxSizer:add(Sizer, Panel, [{proportion, 1}, {flag, ?wxEXPAND}]), wxFrame:setSizer(Frame, Sizer), %% Listen to events wxPanel:connect(Panel, paint, [{callback, fun redraw/2}]), wxFrame:connect(Frame, close_window, [{skip, true}]), %% {skip, true} will let the event be handled by the default handler %% which will close the window %% Show the frame wxFrame:show(Frame), loop(), ok. loop() -> receive #wx{event=#wxClose{}} -> ok; Msg -> io:format("~p:~p: Got ~p~n",[?MODULE, ?FUNCTION_NAME, Msg]), loop() end. %% This is called in a spawned process, so don't deadlock by %% calling the process above while that waits in calls to wx. redraw(#wx{obj=Panel}, _wxPaintEvent) -> %% Create a drawing context on the Panel DC = wxPaintDC:new(Panel), %% You can draw on the DC (old way) with the functions in wxDC module %% Or use a Graphics Contexts to have antialising and nicer graphics GC = wxGraphicsContext:create(DC), wxGraphicsContext:setBrush(GC, ?wxRED_BRUSH), wxGraphicsContext:setFont(GC, ?wxITALIC_FONT, {255,255,255}), {W,H} = wxPanel:getSize(Panel), wxGraphicsContext:drawRoundedRectangle(GC, 35.0,35.0, W-70.0, H-70.0, 10.0), wxGraphicsContext:drawText(GC, "Hello Joe", 60.0, 55.0), %% Nothing is drawn until you destroy your drawing contexts wxGraphicsObject:destroy(GC), wxPaintDC:destroy(DC), ok. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dangud@REDACTED Mon Jul 3 10:40:19 2017 From: dangud@REDACTED (Dan Gudmundsson) Date: Mon, 03 Jul 2017 08:40:19 +0000 Subject: [erlang-questions] wxErlang question 1 In-Reply-To: References: <58d3edda-dcd2-ff1e-8495-9e3339cd366e@wanadoo.fr> <3089AB1C-6BEB-4852-A7FD-D43727A040C3@cs.otago.ac.nz> Message-ID: On Mon, Jul 3, 2017 at 10:24 AM Joe Armstrong wrote: > On Mon, Jul 3, 2017 at 1:09 AM, Richard A. O'Keefe > wrote: > > For me, the gold standard remains Interlisp-D. > > Interlisp reference manual, 1983 edition (I have it beside me > > still), chapter 19 "Interlisp-D Display Facilities". > > 50 pages. Complete. Day 1: I've never written any graphics > > code in my life. Read the chapter. Day 2: read it again. > > Day 3: try some small examples. Day 5: multipane graphic > > debugger for the Prolog "microcode" complete. The nearest > > I've ever found is Tcl/Tk. > > Tcl/Tk was (is) great (bar some rather strange quirks) > > > > > Do the wxWindows tutorials help at all? > > For me, http://docs.wxwidgets.org/stable/overview_helloworld.html > > convinced me to stay away. > > The examples are horrible - an application seem to consist of a number > specific > classes which override or extends the behaviour of the standard classes. > > My problem here is that the standard classes do zillions of things and > which methods > must be overridden or extended to achieve somethings is unobvious. > > Agree.. > In my opinion use of callbacks and an event loop is the wrong way to > do graphics - > wxWidgets (and friends) seem to me to be extremely complex ways of > hiding concurrency > and replacing it with callbacks and an event loop. > > Agree, and it doesn't fit erlang programming modal at all, but the alternative is to go the tcl/tk way and write our own gui-api, but we don't have resources nor interest to do that. And when we started with wxWidgets there where no alternatives, QT was not open source. > Every time I get locked into a modal window I think - "yet another > concurrency failure" > > A typical example is a program that has a form and an account > preferences page. When I'm filling in the form I need some detail that > is the account preferences - but I can't access this until > I've filled in the form - a typical concurrency error. > > Modal dialogs have it's uses, does not confuse non expert users and so on, and for example the file dialog is modal on many OS'es. > I think it might be possible to tame wxErlang but right now I can't > figure out how to even do simple > things. > Example sent in the other thread. > > /Joe > > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Mon Jul 3 10:48:35 2017 From: erlang@REDACTED (Joe Armstrong) Date: Mon, 3 Jul 2017 10:48:35 +0200 Subject: [erlang-questions] wxErlang question 2 In-Reply-To: References: Message-ID: Brilliant thanks a lot - just what I needed to get me started /Joe On Mon, Jul 3, 2017 at 10:29 AM, Dan Gudmundsson wrote: > Q1: > Where is connect and arguments descrbed in the event handler, > which most of the classes inherits from: > See wx.hrl and in http://erlang.org/doc/man/wxEvtHandler.html > > Then you will have to read which class sends which events.. > > Q2: The erlang documentation (or lack there of) does not have the intention > of learning > you how to write gui's with wxWidgets only the differences in the erlang > wrapper. > So you will have to look for that information elsewhere, I have tried to > write examples > and you can also look at the observer code for inspiration. > > I have not read the book it is old but may still be good, I'm not a > wxWidgets expert > I just wrote the erlang wrapper. > > On Sat, Jul 1, 2017 at 5:19 PM Joe Armstrong wrote: >> >> Hello. >> >> I want to make a very simple graphics example in wxErlang >> I want to make a "window" containing a rectangle >> >> Nothing else - this should *not* use the wx_object behaviour but the >> raw wx interface. >> > See below > >> >> I want to understand one thing at a time and not use abstractions layered >> on top >> of the raw interfaces > > > The abstraction cheats, wx have special code for helping with the > abstraction, so it's > useful but here is what you want in 40 lines: > > -module(joe). > > -export([run/0]). > > -include_lib("wx/include/wx.hrl"). > > run() -> > %% Start wx application > _ = wx:new(), > %% Create the OS window (called frame) > NoParent = wx:null(), % This is the top level window, we have no > parent > NoId = ?wxID_ANY, % We can set an id for every widget, > % we don't need a specific id here > Frame = wxFrame:new(NoParent, NoId, "Hello Joe"), > > %% Create a widget as background and drawing area belonging to the > frame. > Panel = wxPanel:new(Frame), > White = {255,255,255}, > wxWindow:setBackgroundColour(Panel, White), > > %% Create a sizer, the sizer handles widgets placement and size > Sizer = wxBoxSizer:new(?wxVERTICAL), > wxSizer:add(Sizer, Panel, [{proportion, 1}, {flag, ?wxEXPAND}]), > wxFrame:setSizer(Frame, Sizer), > > %% Listen to events > wxPanel:connect(Panel, paint, [{callback, fun redraw/2}]), > wxFrame:connect(Frame, close_window, [{skip, true}]), > %% {skip, true} will let the event be handled by the default > handler > %% which will close the window > > %% Show the frame > wxFrame:show(Frame), > loop(), > ok. > > loop() -> > receive > #wx{event=#wxClose{}} -> > ok; > Msg -> > io:format("~p:~p: Got ~p~n",[?MODULE, ?FUNCTION_NAME, Msg]), > loop() > end. > > %% This is called in a spawned process, so don't deadlock by > %% calling the process above while that waits in calls to wx. > redraw(#wx{obj=Panel}, _wxPaintEvent) -> > %% Create a drawing context on the Panel > DC = wxPaintDC:new(Panel), > %% You can draw on the DC (old way) with the functions in wxDC module > > %% Or use a Graphics Contexts to have antialising and nicer graphics > GC = wxGraphicsContext:create(DC), > wxGraphicsContext:setBrush(GC, ?wxRED_BRUSH), > wxGraphicsContext:setFont(GC, ?wxITALIC_FONT, {255,255,255}), > {W,H} = wxPanel:getSize(Panel), > wxGraphicsContext:drawRoundedRectangle(GC, 35.0,35.0, W-70.0, H-70.0, > 10.0), > wxGraphicsContext:drawText(GC, "Hello Joe", 60.0, 55.0), > > %% Nothing is drawn until you destroy your drawing contexts > wxGraphicsObject:destroy(GC), > wxPaintDC:destroy(DC), > ok. > > > >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From anders.gs.svensson@REDACTED Mon Jul 3 12:22:15 2017 From: anders.gs.svensson@REDACTED (anders.gs.svensson@REDACTED) Date: Mon, 3 Jul 2017 12:22:15 +0200 Subject: [erlang-questions] synchronous diameter_app:handle_request() -- how to spawn a worker? In-Reply-To: References: Message-ID: <22874.6871.240395.98543@gargle.gargle.HOWL> Each handle_request callback happens in a process that's spawned for that purpose, so concurrency is already there. You can do what you want in the callback as long as it (eventually) returns an answer (or not). Or are you looking for more control over the request processes? Anders erlang-questions-request@REDACTED writes: > Date: Mon, 03 Jul 2017 02:07:52 +0200 > From: Rick van Rein > To: Questions erlang-questions > Subject: [erlang-questions] synchronous diameter_app:handle_request() > -- how to spawn a worker? > Message-ID: <59598AD8.3020300@REDACTED> > Content-Type: text/plain; charset=ISO-8859-1 > > Hi, > > I built authorisation code in Erlang, and am now trying to put Diameter > in front of it. > > The code takes a fair bit of data and time, so I am preparing to split > the data over nodes and redirect requests with Erlang's builtins, at the > same time monitoring it for high availability. > > In diameter_app however, the handle_request() callback wants a final > response. Deferring it with "noreply" is not mentioned as an option. > Is there another way to initiate concurrency in handling requests? > > Thanks, > -Rick From rick@REDACTED Mon Jul 3 12:53:20 2017 From: rick@REDACTED (Rick van Rein) Date: Mon, 03 Jul 2017 12:53:20 +0200 Subject: [erlang-questions] synchronous diameter_app:handle_request() -- how to spawn a worker? In-Reply-To: <22874.6871.240395.98543@gargle.gargle.HOWL> References: <22874.6871.240395.98543@gargle.gargle.HOWL> Message-ID: <595A2220.30508@openfortress.nl> Ah! > Each handle_request callback happens in a process that's spawned for > that purpose, so concurrency is already there. That makes sense! I seem to have misread the diameter documentation to suggest that it would setup a diameter_app for each transport connection. It probably was the phrasing under {restrict_connections,...} or {share_peers,...} that got me to hold the wrong end of the stick. > You can do what you > want in the callback as long as it (eventually) returns an answer (or > not). Clear. > Or are you looking for more control over the request processes? No, this is all that I needed. Proper understanding :) Thanks! -Rick From tobias.lindahl@REDACTED Mon Jul 3 15:56:14 2017 From: tobias.lindahl@REDACTED (Tobias Lindahl) Date: Mon, 3 Jul 2017 15:56:14 +0200 Subject: [erlang-questions] Tricking dialyzer with an opaque type In-Reply-To: <5F791844-BA87-48E9-81BE-6ADC7D54231D@kallisys.net> References: <90E97C86-D51F-4A93-9100-14DCEDAA381B@gmail.com> <5F791844-BA87-48E9-81BE-6ADC7D54231D@kallisys.net> Message-ID: 2017-06-30 15:50 GMT+02:00 Paul Guyot : > Alex, Tobias, > > Indeed, the function constructs the set using gb_sets API and then the > result is embedded in the module with erl_parse:abstract/1. > The current solution consists in adding a call to an identity/1 function > in the generated replacement code. This function is exported from the parse > transform module of type fun(any()) -> any(). Since the parse transform is > in another application, dialyzer seems to take its specification for > granted (?). It's a cheaper equivalent of binary_to_term(term_to_binary(V)), > although not free (it's still a remote call). > Sorry, I misunderstood. If you are worried about the remote call, you can probably achieve the same thing by having a local call and exporting the function. You need the export to confuse Dialyzer enough to label it as any(). > > Paul > > On 30 Jun 2017, at 15:29, Alex S. wrote: > > he is constructing it, after parse transform takes place. > > 30 ???? 2017 ?., ? 14:27, Tobias Lindahl > ???????(?): > > It seems to me that the gb_sets:from_list/1 should give the correct type > for your function even if the spec is not taken into account. > > In that case, the value you are getting warnings for comes from somewhere > else. Could it be that you are deconstructing the opaque type somewhere? > > > 2017-06-25 18:56 GMT+02:00 Paul Guyot : > >> Hello, >> >> I do have a parse transform that replaces the body of a 0-arity function >> with its result, as evaluated at compile time. >> I am looking for a way to avoid an opaque violation warning from dialyzer >> when this function returns, say, a gb_sets:set(). The spec is properly >> copied into the parsed tree, but dialyzer just ignores it. >> >> Typically, such a function would load data from a file and create a >> gb_sets:set() from this data. >> >> -spec f() -> gb_sets:set(unicode:unicode_binary()). >> f() -> >> {ok, Content} = file:read_file(?FILENAME), >> List0 = binary:split(Content, <<"\n">>, [global]), >> List1 = lists:filter(fun(W) -> W =/= <<>> end, List0), >> gb_sets:from_list(List1). >> >> With the parse_transform, dialyzer complains on usage, e.g. : >> >> [warning] some_module.erl:123 the call gb_sets:add(,Var::{1..1114111,{_,_,_}}) >> does not have an opaque term of type gb_sets:set(_) as 2nd argument >> >> Yet, of course, some_module.erl does not violate the opacity of >> gb_sets:set() itself. >> I can trick dialyzer with an expensive identity function: >> >> gb_sets:add(Value, binary_to_term(term_to_binary(Var))) >> >> Any better idea? >> >> Paul >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Mon Jul 3 20:10:59 2017 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Mon, 3 Jul 2017 21:10:59 +0300 Subject: [erlang-questions] Scaling SSL wrapped websockets - experiences In-Reply-To: References: Message-ID: <7E835E4C-7768-4A5E-9B96-A387936908A4@gmail.com> Hello, There was posts at Internet about 2M connection per node. http://www.phoenixframework.org/blog/the-road-to-2-million-websocket-connections I?ve scale it up to 1M connection on AWS long time ago. This numbers is ?easy? to achieve out of box for system with low traffic. I had the following traffic pattern 20 connection per second (poisson arrival rate), connections stays idle but clients shows 3 second think time (poisson rate). The major concern was a memory all the time. The out of box deployment on AWS large instance was capable to handle 300K connections before OOM. I?ve use hibernate feature aggressively to reduce memory demand. Finally, I?ve used 2xlarge node to run the system. The latency was not an issue. The message scheduling was good while CPU utilization was below 70%. However, I?ve reduce logging to error-level and made the nodes responsible for message routing only. I?ve learn that you need to keep in balance CPU/Memory to get acceptable results but this depends on your traffic. Unfortunately, that set-up excluded SSL. I was not successful to scale SSL up to 1M due to heavier memory demand (I?ve user OTP 18 for that problem). Unfortunately, I do not recall exactly the number of concurrent SSL connection (cannot find the data sheets). It was high >>20K but <<100M for sure. Frankly speaking, I would design a system around ELB to terminate SSL traffic and use weighted load balancing feature to scale ELB connectivity then rush for high concurrency on single node due to operational simplicity. I hope, I shed some light on your problem. Best Regards, Dmitry > On Jul 2, 2017, at 12:56 PM, Paul Peregud wrote: > > I'm looking at SSL + websocket + cowboy scaling with regards to number > of simultaneous connections. I'm interested in relationship between > number of connections and latency of message delivery. Is there any > data on performance of SSL implementation in BEAM? > > Best regards, > Paul Peregud > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From eriksoe@REDACTED Mon Jul 3 22:16:40 2017 From: eriksoe@REDACTED (=?UTF-8?Q?Erik_S=C3=B8e_S=C3=B8rensen?=) Date: Mon, 3 Jul 2017 22:16:40 +0200 Subject: [erlang-questions] Scaling SSL wrapped websockets - experiences In-Reply-To: <7E835E4C-7768-4A5E-9B96-A387936908A4@gmail.com> References: <7E835E4C-7768-4A5E-9B96-A387936908A4@gmail.com> Message-ID: In my experience with many simultaneous SSL connections in Erlang, what surprised me was that as default, Erlang is configured to have reusable/continuable SSL sessions. This means that some ETS table containing the session info can grow fairly large. That feature can be disabled, however, which helps a great deal on memory usage. - Erik 2017-07-03 20:10 GMT+02:00 Dmitry Kolesnikov : > Hello, > > There was posts at Internet about 2M connection per node. > http://www.phoenixframework.org/blog/the-road-to-2- > million-websocket-connections > > I?ve scale it up to 1M connection on AWS long time ago. This numbers is > ?easy? to achieve out of box for system with low traffic. I had the > following traffic pattern 20 connection per second (poisson arrival rate), > connections stays idle but clients shows 3 second think time (poisson rate). > > The major concern was a memory all the time. The out of box deployment on > AWS large instance was capable to handle 300K connections before OOM. I?ve > use hibernate feature aggressively to reduce memory demand. Finally, I?ve > used 2xlarge node to run the system. > > The latency was not an issue. The message scheduling was good while CPU > utilization was below 70%. However, I?ve reduce logging to error-level and > made the nodes responsible for message routing only. I?ve learn that you > need to keep in balance CPU/Memory to get acceptable results but this > depends on your traffic. > > Unfortunately, that set-up excluded SSL. I was not successful to scale SSL > up to 1M due to heavier memory demand (I?ve user OTP 18 for that problem). > Unfortunately, I do not recall exactly the number of concurrent SSL > connection (cannot find the data sheets). It was high >>20K but <<100M for > sure. > > Frankly speaking, I would design a system around ELB to terminate SSL > traffic and use weighted load balancing feature to scale ELB connectivity > then rush for high concurrency on single node due to operational simplicity. > > I hope, I shed some light on your problem. > > Best Regards, > Dmitry > > > > On Jul 2, 2017, at 12:56 PM, Paul Peregud wrote: > > > > I'm looking at SSL + websocket + cowboy scaling with regards to number > > of simultaneous connections. I'm interested in relationship between > > number of connections and latency of message delivery. Is there any > > data on performance of SSL implementation in BEAM? > > > > Best regards, > > Paul Peregud > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbike2000ru@REDACTED Tue Jul 4 08:37:31 2017 From: mbike2000ru@REDACTED (Dmitry) Date: Tue, 4 Jul 2017 06:37:31 +0000 (UTC) Subject: [erlang-questions] How to install recon In-Reply-To: <1049669228.3106347.1498565229636@mail.yahoo.com> References: <415793089.3022383.1498551876840.ref@mail.yahoo.com> <415793089.3022383.1498551876840@mail.yahoo.com> <893811395.3069810.1498556141862@mail.yahoo.com> <1049669228.3106347.1498565229636@mail.yahoo.com> Message-ID: <1953745697.4020502.1499150251159@mail.yahoo.com> When I added recon to the reltool.config - the problem disappeared. On Tuesday, June 27, 2017, 5:07:09 PM GMT+5, Dmitry wrote: when I do: application:ensure_all_started(recon). {error,{recon,{"no such file or directory","recon.app"}}}? On Tuesday, June 27, 2017, 2:35:41 PM GMT+5, Dmitry wrote: I added recon to app.src file but still no luck Here is my app.src file: {application, acceptor, [ ??{description, ""}, ??{vsn, "1"}, ??{registered, []}, ??{applications, [ ??????????????????kernel, ??????????????????stdlib, ??????????????????ranch, ??????????????????recon ???????????????? ]}, ??{mod, { acceptor_app, []}}, ??{env, []} ]}.? On Tuesday, June 27, 2017, 1:40:55 PM GMT+5, Roger Lipscombe wrote: Also: is it added to the list of applications in your *release*? I don't know how to do that with "rebar generate", but using relx, via rebar3, it looks like this: {relx, [ ? ? {release, {foo, "1"}, [ ? ? ? ? foo, bar, baz, ? ? ? ? {runtime_tools, load}, ? ? ? ? {recon, load} ? ? ]}, 'load' means "include it, but don't attempt to start it". We also specify 'runtime_tools' so we can get 'dbg', etc. On 27 June 2017 at 09:34, Luis Rasc?o wrote: > Maybe you didn't add it to .app.src? > > On Tue, Jun 27, 2017 at 9:24 AM, Dmitry wrote: >> >> Hello >> >> >> I included recon as a dependency in rebar.config, >> >> After compilation and release generating (rebar compile and rebar >> generate) I attached to the node and I see that all recon functions are >> undefined. >> >> What am I missing? >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > > -- > PGP fingerprint: F708 E141 AE8D 2D38 E1BC? DF3D 1719 3EA0 647D 7260 > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sverker.eriksson@REDACTED Tue Jul 4 15:02:24 2017 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Tue, 4 Jul 2017 15:02:24 +0200 Subject: [erlang-questions] Patch Package 20.0.1 Released In-Reply-To: References: Message-ID: <3dce3004-9a04-0d47-9f6a-ed246db76429@ericsson.com> Patch Package: OTP 20.0.1 Git Tag: OTP-20.0.1 Date: 2017-07-03 Trouble Report Id: OTP-13939, OTP-14479, OTP-14481, OTP-14482, OTP-14484, OTP-14487, OTP-14489 Seq num: ERIERL-40, ERL-193, ERL-438 System: OTP Release: 20 Application: common_test-1.15.1, erts-9.0.1, runtime_tools-1.12.1, stdlib-3.4.1, tools-2.10.1 Predecessor: OTP 20.0 Check out the git tag OTP-20.0.1, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- common_test-1.15.1 ---------------------------------------------- --------------------------------------------------------------------- The common_test-1.15.1 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-14489 Application(s): common_test, stdlib, tools Related Id(s): ERL-438 In OTP-20.0, the behavior of c, make, and ct_make was changed so that in some cases the beam files by default would be written to the directory where the source files were found. This is now changed back to the old behavior so beam files are by default written to current directory. Full runtime dependencies of common_test-1.15.1: compiler-6.0, crypto-3.6, debugger-4.1, erts-7.0, inets-6.0, kernel-4.0, observer-2.1, runtime_tools-1.8.16, sasl-2.4.2, snmp-5.1.2, ssh-4.0, stdlib-2.5, syntax_tools-1.7, tools-2.8, xmerl-1.3.8 --------------------------------------------------------------------- --- erts-9.0.1 ------------------------------------------------------ --------------------------------------------------------------------- The erts-9.0.1 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-13939 Application(s): erts, kernel Related Id(s): ERL-193 Fixed a bug in gen_tcp:send where it never returned when repeatedly called on a remotely closed TCP socket. OTP-14481 Application(s): erts Fixed segfault that could happen during cleanup of aborted erlang:port_command/3 calls. A port_command is aborted if the port is closed at the same time as the port_command was issued. This bug was introduced in erts-8.0. OTP-14484 Application(s): erts Fixed implementation of statistics(wall_clock) and statistics(runtime) so that values do not unnecessarily wrap due to the emulator. Note that the values returned by statistics(runtime) may still wrap due to limitations in the underlying functionality provided by the operating system. OTP-14491 Application(s): erts Fix performance bug in pre-allocators that could cause them to permanently fall back on normal more expensive memory allocation. Pre-allocators are used for quick allocation of short lived meta data used by messages and other scheduled tasks. Bug exists since OTP_R15B02. Full runtime dependencies of erts-9.0.1: kernel-5.0, sasl-3.0.1, stdlib-3.0 --------------------------------------------------------------------- --- runtime_tools-1.12.1 -------------------------------------------- --------------------------------------------------------------------- The runtime_tools-1.12.1 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-14479 Application(s): runtime_tools A faulty encoding comment was added when saving trace patterns to file. This is now corrected. Full runtime dependencies of runtime_tools-1.12.1: erts-8.0, kernel-5.0, mnesia-4.12, stdlib-3.0 --------------------------------------------------------------------- --- stdlib-3.4.1 ---------------------------------------------------- --------------------------------------------------------------------- The stdlib-3.4.1 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-14482 Application(s): stdlib Related Id(s): PR-1488 A bug in proc_lib:format() introduced in Erlang/OTP 20.0 is corrected. OTP-14487 Application(s): stdlib Related Id(s): ERIERL-40 Fix string:len/1 to be compatible with previous versions. OTP-14489 Application(s): common_test, stdlib, tools Related Id(s): ERL-438 In OTP-20.0, the behavior of c, make, and ct_make was changed so that in some cases the beam files by default would be written to the directory where the source files were found. This is now changed back to the old behavior so beam files are by default written to current directory. Full runtime dependencies of stdlib-3.4.1: compiler-5.0, crypto-3.3, erts-9.0, kernel-5.0, sasl-3.0 --------------------------------------------------------------------- --- tools-2.10.1 ---------------------------------------------------- --------------------------------------------------------------------- The tools-2.10.1 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-14489 Application(s): common_test, stdlib, tools Related Id(s): ERL-438 In OTP-20.0, the behavior of c, make, and ct_make was changed so that in some cases the beam files by default would be written to the directory where the source files were found. This is now changed back to the old behavior so beam files are by default written to current directory. Full runtime dependencies of tools-2.10.1: compiler-5.0, erts-7.0, kernel-3.0, runtime_tools-1.8.14, stdlib-3.1 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From erlang@REDACTED Tue Jul 4 18:18:34 2017 From: erlang@REDACTED (Joe Armstrong) Date: Tue, 4 Jul 2017 18:18:34 +0200 Subject: [erlang-questions] wxErlang - some answers Message-ID: I'm trying to get to grips with wxErlang so I toddled over to Ericsson and sat down for a few hours with Dan Gudmundsson and asked him a boat load of stupid questions. I'll be writing a lot more about this and setting up a github project to document how to get tame wxErlang ... Here's a first attempt at figuring out how things work. My usual approach to understanding things is always the same. "Take a program that works. Then remove non-essential bits until all that is left is so simple that you can understand it." How about making some buttons - this should be easy I started with demo.erl in ${ERL_TOP}/lib/wx/examples/demo/demo.erl This has some code for making buttons - but it also does *a lot more* and *it is highly redundant* -- from the point of view of learning the code volume does not assist comprehension, nor does using a generic behavior. What do I mean by this? - ex_button.erl is written using wx_object.erl so to understand ex_button.erl I have to also understand wx_object.erl - ex_button.erl has repeated code. For example several buttons have tooltips, but I only need to be shown how to do this *once* not several times - ex_button.erl introduces several new concepts - in particular spacers and sizers - and I haven't a clue what they do. Now I'm going to refactor ex_button.erl so take a deep breath ... First refactoring: remove the dependency on wx_object I'd already figured out that a *minimal* wx windows program is: start() -> Wx = wx_win:new(), Frame = wxFrame:new(Wx, -1, "Window Title"), wxFrame:show(Frame). To make the window do something I'd want to write: start() -> Wx = wx_win:new(), Frame = wxFrame:new(Wx, -1, "Window Title"), setup_window(Frame), wxFrame:show(Frame), loop(). loop() -> receive Any -> io:format("Any=~p~n",[Any]) end, loop(). Given this structure I refactored ex_button.erl into buttons_demo.erl which removes all the wx_object code. So now I can stare are the code in buttons_demo.erl and see if I can understand it, for my point of view it's far easier to understand than ex_buttons.erl since there is no dependency on wx_object.erl Second refactoring: Simplify buttons_demo.erl The original program has four rows of buttons - but one will be sufficient for me. I now removed many lines of code, until only one line of buttons remained. The resulting code buttons_demo1.erl now only creates one line of buttons and has a couple of sizers. Dan told me that the line of code: wxStaticBoxSizer:new(?wxHORIZONTAL, Panel,[{label, "wxButton"}]), Is wxWidgets way of making an hbox - Goodness wxWidgets can be build using Knuthian hboxes and vboxes (horray). I'm still not happy with buttons_demo1.erl since it mixes two ideas: - making buttons - putting buttons in a container and laying out the containers This needs to be refactored into: - a pure button examples - a pure layout example My intention is to try and decompose wxErlang into a large number of small examples, where each example illustrates one feature of the system. Also so show how to build complex examples from the small parts. I'll make all the code available on github so you can join in the fun (is this fun?). Notes: [1] Feel free to send me examples of wxErlang code - preferably one example per module that illustrates one feature. [2] Anybody want to do this for elixir? [3] The WxWidgets documentation is a terminological mess - they call *everything* (including a button) a window. [4] The WxWidget examples (in C++) require subclassing several objects resulting in multiple files per example - the Erlang equivalent is nicely contained within a single module (which is far nicer) -------------- next part -------------- A non-text attachment was scrubbed... Name: ex_button.erl Type: application/octet-stream Size: 7368 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: buttons_demo.erl Type: application/octet-stream Size: 5464 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: buttons_demo1.erl Type: application/octet-stream Size: 1968 bytes Desc: not available URL: From ok@REDACTED Wed Jul 5 03:20:00 2017 From: ok@REDACTED (Richard A. O'Keefe) Date: Wed, 5 Jul 2017 13:20:00 +1200 Subject: [erlang-questions] Off-topic question about Universities Message-ID: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> My University is about to go through a process of redesigning its logo. I'm interested in whether having a logo, a "brand", actually matters for a University. Obviously it does for soap, tinned soup, and so on. Some of you are at Universities, and some of you are at companies that hire graduates from Universities, and some of you are graduates from Universities or considering (further) study. So there should be some overlap with the target audience of a logo. So I was wondering if anyone had any strong opinions about Universities and logos, and better yet, any evidence. According to the Vice-Chancellor, The University logo is the most prominent visual aspect of the overarching University brand. Continuity and consistency of logo use is the most valuable asset a brand has. This is what builds recognition and awareness for an organisation, it is the foundation on which the visual identification of the University is built. You might be as surprised as I was that reputation, quality, price, published research, patents, and so on are not as valuable to a University brand as a logo. You might also be surprised that visual recognition of a University is so important. (Imagine the Prime Minister at the supermarket. "I'll have a kilo of University of Otago, please. No, not that. That's the logo with an *open* book, I want the one with the *closed* book.") Well, I guess I'll never be smart enough to be a VC. You might also be puzzled that if "Continuity and consistency of logo use is the most valuable asset a brand has" introducing discontinuity and inconsistency by changing the logo could ever be desirable. If so, you have overdosed on the Logic pills. I know I have! From zxq9@REDACTED Wed Jul 5 03:57:40 2017 From: zxq9@REDACTED (zxq9) Date: Wed, 05 Jul 2017 10:57:40 +0900 Subject: [erlang-questions] Off-topic question about Universities In-Reply-To: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> References: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> Message-ID: <25440028.xbzjO0ViKK@changa> On 2017?07?05? ??? 13:20:00 Richard A. O'Keefe wrote: > So I was wondering if anyone had any strong opinions about Universities > and logos, and better yet, any evidence. Anecdotal, but perhaps relevant... The last three places I've contracted did not seem to take university into account at all with regard to hiring candidates. They did take publicly visible projects, programming blogs, stackoverflow answers, published works, ML involvement, and similar things into account before giving someone a trial project. The trial project and interviews were the only thing they cared about. The candidate's public brand (within the technical community) mattered because it acted as a filter for deciding whether or not to spend the effort reviewing a trial project. The trial project mattered and acted as a further filter to determine whether to spend effort on an interview. The interview was more of a process of discovering red flags, an opportunity to show how disqualifyingly troublesome or weird you may be as a person. Hired on the basis of performance, disqualified on the basis of profound personality issues (obviously they give people quite a bit of leeway personally, as I was accepted). LinkedIn, university degrees, certifications, etc. did not count for much, if anything. Clearly, if the university is a place to get trained and the point of that training is to get a job but all the employers care about are the resulting skills and not where you got them, then a university logo can only matter at all in the minds of the students. This assumes that we are approaching the question of logos from the perspective of students who are trying to get jobs, but from the administrators' perspective the educational function of the university may well be one of the least important aspects of the organization and therefore branding. Perhaps this matters more in the grant market, the admissions market, the other-forms-of-public-funding market, the paid-dinner donations/regency market, patent license market, recruitment of primary investigators, and so on. Maybe perceived coolness in branding is paramount there. But in terms of the jobs market that graduates will face... well, its just about the last thing anyone is even aware of, much less concerned with. For the record, the last three places I've contracted were mostly remote work[1], were focused on infrastructure, and needed pretty specific things designed, not merely implemented, were contract-term employment (not full-time forever and ever) -- and paid pretty well. That is a very tiny slice of the job market. I have no idea what 9-5 places would care about. Also, I've never been to university (as a student, anyway) so I'm not sure how things would differ for me had I a degree. > According to the Vice-Chancellor I'm so glad that this is an actual title for someone somewhere. Images of the Galactic Senate in the Star Wars prequels immediately come to mind... > You might also be puzzled that if "Continuity and consistency > of logo use is the most valuable asset a brand has" introducing > discontinuity and inconsistency by changing the logo could > ever be desirable. If so, you have overdosed on the Logic pills. > I know I have! Indeed! The exercise itself seems to defeat the purpose of the exercise. -Craig [1] I only performed any in-person work on one of the three jobs. Bringing the group physically together for two weeks was at my request, not a requirement -- fortunately it was a swell group of folks and they all agreed. From marco.molteni@REDACTED Wed Jul 5 08:33:13 2017 From: marco.molteni@REDACTED (Marco Molteni) Date: Wed, 5 Jul 2017 08:33:13 +0200 Subject: [erlang-questions] Off-topic question about Universities In-Reply-To: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> References: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> Message-ID: <0E9C4279-8095-4FE9-99AC-DB104A04E800@laposte.net> I have been hiring candidates as software engineers in the telecommunication and software industry for more than ten years. I myself have a master in CS. According to the position, I look also for the University degree, with a healthy dose of skepticism, since, say, being graduated in CS has no relationship with the ability (or not) of being able to write maintainable code. We give various levels of programming exercises to try to evaluate the candidate ability to understand a problem, come up with clean, readable, simple, tested code. We don't do stupid whiteboard coding exercises or CS theoretical questions that require to be fresh out of University. We then try to evaluate if the candidate is smart, able to work in a group or is a jerk. Regarding the University logo, frankly, I don't even look at it, why should I ? :-) marco From essen@REDACTED Wed Jul 5 11:51:40 2017 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Wed, 5 Jul 2017 11:51:40 +0200 Subject: [erlang-questions] Off-topic question about Universities In-Reply-To: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> References: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> Message-ID: <73bba216-8541-5326-6518-4918f5c7e286@ninenines.eu> You missed the keyword *visual*. Images are very persuasive and they're one important aspect of a brand. It's not the entire representation of a brand, however. I would argue that famous alumnees are a more important image for a University brand. If your University was creating the Bill Gates and Warren Buffet(s) of the world, you'd probably want a picture of them instead of your logo. Otherwise, a University has little more imagery than its logo, and perhaps a few landmarks. So he's not incorrect in his statement. On 07/05/2017 03:20 AM, Richard A. O'Keefe wrote: > My University is about to go through a process of redesigning its logo. > I'm interested in whether having a logo, a "brand", actually matters > for a University. Obviously it does for soap, tinned soup, and so on. > > Some of you are at Universities, and some of you are at companies that > hire graduates from Universities, and some of you are graduates from > Universities or considering (further) study. So there should be some > overlap with the target audience of a logo. > > So I was wondering if anyone had any strong opinions about Universities > and logos, and better yet, any evidence. > > According to the Vice-Chancellor, > > The University logo is the most prominent visual aspect of > the overarching University brand. Continuity and consistency > of logo use is the most valuable asset a brand has. > This is what builds recognition and awareness for an organisation, > it is the foundation on which the visual identification of > the University is built. > > You might be as surprised as I was that reputation, quality, price, > published research, patents, and so on are not as valuable to a > University brand as a logo. You might also be surprised that > visual recognition of a University is so important. (Imagine > the Prime Minister at the supermarket. "I'll have a kilo of > University of Otago, please. No, not that. That's the logo > with an *open* book, I want the one with the *closed* book.") > Well, I guess I'll never be smart enough to be a VC. > > You might also be puzzled that if "Continuity and consistency > of logo use is the most valuable asset a brand has" introducing > discontinuity and inconsistency by changing the logo could > ever be desirable. If so, you have overdosed on the Logic pills. > I know I have! > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin https://ninenines.eu From mithunb@REDACTED Wed Jul 5 12:27:05 2017 From: mithunb@REDACTED (Mithun B) Date: Wed, 5 Jul 2017 15:57:05 +0530 Subject: [erlang-questions] Get Erlang node uptime and way to test it is working In-Reply-To: <77a51db0-eae2-3cb6-64b2-60305531cca6@erlang.org> References: <57c99e11-036d-5e97-d393-725903e98e3f@utl.in> <77a51db0-eae2-3cb6-64b2-60305531cca6@erlang.org> Message-ID: <4697c137-5d40-3ada-8071-685bad16909a@utl.in> Hi everyone, I am glad that Mr. Rickard Green and Mr. Richard Carlsson gave some insight about the problem, with using erlang:statistics(wall_clock) in Erlang OTP 19. Any Idea how to test this without waiting for 50 days for actually see its working fine. I mean what if I need to test for 100 days or more, it doesn't look logical. with regards, Mithun B On Thursday 22 June 2017 06:03 PM, Rickard Green wrote: > Hmm, looked closer at statistics(wall_clock) and found that it is > buggy on 32-bit architectures. This due to an unfortunate cast which > causes it to wrap after approximately 50 days. This will be fixed in > an upcoming patches for OTP 19 and 20. > > Internally erlang:statistics(wall_clock) use Erlang monotonic time, so > it will be as accurate as using erlang monotonic time directly. It is > however not as efficient as using erlang monotonic time directly due > to the locking that is needs. That is, the recommended way to get this > info is: > erlang:convert_time_unit(erlang:monotonic_time() - > erlang:system_info(start_time), native, TheTimeUnitYouWant). > > Regards, > Rickard, Erlang/OTP, Ericsson AB > > On 06/22/2017 10:45 AM, Richard Carlsson wrote: >> Would be good to patch the uptime function in c.erl, in that case, >> since that uses wall_clock. >> >> >> /Richard >> >> 2017-06-20 12:56 GMT+02:00 Rickard Green > >: >> >> >> tis 20 juni 2017 kl. 09:21 skrev Mithun B > >: >> >> Hi all, >> >> We are using "erlang:statistics(wall_clock)" to get the Erlang >> node up >> time in millisecond. >> >> It works fine till 49 days, but on 49th day it will role back to >> start >> from 0 millisecond. >> >> I need to know two things here, First of all, a different method >> for how >> to test it, I don't want to wait for 49+ days to see it works or >> not. >> >> Secondly, I need to know a method which gives proper up time >> even after >> 49+ days. How about following: >> >> "(erlang:monotonic_time() - erlang:system_info(start_time)) div >> 1000000000" >> >> >> Apart from the assumption of nanosecond native time unit this is the >> way to do it. Use erlang:convert_time_unit() instead. There are >> Erlang systems not using nanoseconds as native time unit. >> >> Regards, >> Rickard Green, Erlang/OTP >> >> >> If any one having more insight on this, please shed some light >> on these >> topics. >> >> Thanks and regards, >> >> Mithun B >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> -- Rickard Green, Erlang/OTP, Ericsson AB >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> > > From mentel.kk@REDACTED Wed Jul 5 12:42:58 2017 From: mentel.kk@REDACTED (Kacper Mentel) Date: Wed, 5 Jul 2017 12:42:58 +0200 Subject: [erlang-questions] ETS performance visualisation Message-ID: Hi! My name is Kacper and I'm participating in this year's edition of Google Summer of Code under BEAM Community. My GSoC's project is an extension to Erlang Performance Lab. Erlang Lab is an Open Source project aimed at analysing the performance of Erlang and Elixir systems. The project provides web-based visualisations of the analysis. It can help developers to better understand their systems, observe the system behaviour and identify weaknesses. My work is focused on visualising ETS tables performance. If you want to learn more about my GSoC project or erlangpl here are the links to have a look at: https://summerofcode.withgoogle.com/projects/#5695385677856768 https://github.com/erlanglab/erlangpl https://github.com/mkacper/erlangpl The extension to the EPL I'm going to implement will deliver 3 views which can be seen as layers through which you can look at the ETS tables. The idea is simple ? if you want to trace a problem related to an ETS table, you start from the top-level view (the most general one) and go down through the subsequent layers (views) until you reach the one that will help you identify the source of the problem you are looking for. The scheme of the views looks as follows: cluster view (shows all the nodes in a cluster) -> node view (shows all ETS tables on a node) -> ETS details (shows more detailed information). I've implemented the first view so far. Here is the screenshot: https://drive.google.com/file/d/0BzXT6yCa9ckQVzF 0RnhibG9LbFE/view?usp=sharing Now I'm working on the second view (node view). Here are some screenshots: https://drive.google.com/file/d/0BzXT6yCa9ckQTXNuTzYzVW00c1U /view?usp=sharing https://drive.google.com/file/d/0BzXT6yCa9ckQS05QQ3pWeWI5bkU /view?usp=sharing It shows all the ETS tables from a node linked to their owner's processes. The color of the tables reflects the amount of allocated memory for the table (red -> the heaviest, blue -> the lightest). This is only an example how we can visualise ETS related data. The most imprtant questions to you are: - What is worth measuring and visualising in terms of ETS performance? - What kind of information can help developers to find ETS related problems? Here are some of my (and EPL team's) ideas: - the amount of the allocated memory for a particular ETS table, - memory utilization/fragmentation - real size of a particular table in bytes compared to the amount of the memory allocated for that table - number of rows in a partiuclar table - some statistics about locks protecting ETS tables (collected using lcnt module) - mean acces time to the table in a unit of time I would be very grateful for your feedback, suggestions and ideas. Cheers, Kacper -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchamagne@REDACTED Wed Jul 5 13:02:40 2017 From: bchamagne@REDACTED (Bastien CHAMAGNE) Date: Wed, 5 Jul 2017 13:02:40 +0200 Subject: [erlang-questions] ETS performance visualisation In-Reply-To: References: Message-ID: Hi Kacper, amazing idea. Without thinking too much I'd say: "writes per seconds", "reads per seconds" are good metrics. Whether write_concurrency or read_concurrency is enabled. Good luck on this project! On 05/07/2017 12:42, Kacper Mentel wrote: > Hi! > > My name is Kacper and I'm participating in this year's edition of > Google Summer of Code under BEAM Community. My GSoC's project is an > extension to Erlang Performance Lab. Erlang Lab is an Open Source > project aimed at analysing the performance of Erlang and Elixir > systems. The project provides web-based visualisations of the > analysis. It can help developers to better understand their systems, > observe the system behaviour and identify weaknesses. > > My work is focused on visualising ETS tables performance. If you want > to learn more about my GSoC project or erlangpl here are the links to > have a look at: > > https://summerofcode.withgoogle.com/projects/#5695385677856768 > > https://github.com/erlanglab/erlangpl > > https://github.com/mkacper/erlangpl > > The extension to the EPL I'm going to implement will deliver 3 views > which can be seen as layers through which you can look at the ETS > tables. The idea is simple ? if you want to trace a problem related to > an ETS table, you start from the top-level view (the most general one) > and go down through the subsequent layers (views) until you reach the > one that will help you identify the source of the problem you are > looking for. The scheme of the views looks as follows: cluster view > (shows all the nodes in a cluster) -> node view (shows all ETS tables > on a node) -> ETS details (shows more detailed information). > > I've implemented the first view so far. Here is the screenshot: > https://drive.google.com/file/d/0BzXT6yCa9ckQVzF0RnhibG9LbFE/view?usp=sharing > > > Now I'm working on the second view (node view). Here are some screenshots: > https://drive.google.com/file/d/0BzXT6yCa9ckQTXNuTzYzVW00c1U/view?usp=sharing > > https://drive.google.com/file/d/0BzXT6yCa9ckQS05QQ3pWeWI5bkU/view?usp=sharing > > > It shows all the ETS tables from a node linked to their owner's > processes. The color of the tables reflects the amount of allocated > memory for the table (red -> the heaviest, blue -> the lightest). This > is only an example how we can visualise ETS related data. > > The most imprtant questions to you are: > - What is worth measuring and visualising in terms of ETS performance? > - What kind of information can help developers to find ETS related > problems? > > Here are some of my (and EPL team's) ideas: > > - the amount of the allocated memory for a particular ETS table, > - memory utilization/fragmentation - real size of a particular table > in bytes compared to the amount of the memory allocated for that table > - number of rows in a partiuclar table > - some statistics about locks protecting ETS tables (collected using > lcnt module) > - mean acces time to the table in a unit of time > > I would be very grateful for your feedback, suggestions and ideas. > > Cheers, > Kacper > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc@REDACTED Wed Jul 5 13:41:44 2017 From: marc@REDACTED (Marc Worrell) Date: Wed, 5 Jul 2017 13:41:44 +0200 Subject: [erlang-questions] Zotonic - becoming OTP apps Message-ID: <84807B12-E2F4-41DE-A16E-8FE774D6D3AA@worrell.nl> Zotonic is the Erlang open source Content Management System and Framework. We have a breaking update coming. The coming days we will add OTP compatibility to Zotonic. For this we are splitting Zotonic in many loose OTP applications and publish those as Hex packages. There will also be an umbrella Zotonic project that can act as an application server. In the coming weeks we will finalize the last missing OTP bits (think rebar3 templates and module installation). The result will be tagged Zotonic as 1.0.0-alpha1 and publish all the Hex packages. More information is here http://zotonic.com/blog/1097/splitting-up-zotonic-in-otp-apps---big-changes-coming Cheers, Marc and all others of the Zotonic team. From jesper.louis.andersen@REDACTED Wed Jul 5 15:09:25 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Wed, 05 Jul 2017 13:09:25 +0000 Subject: [erlang-questions] Off-topic question about Universities In-Reply-To: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> References: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> Message-ID: On Wed, Jul 5, 2017 at 3:20 AM Richard A. O'Keefe wrote: > My University is about to go through a process of redesigning its logo. > I'm interested in whether having a logo, a "brand", actually matters > for a University. Obviously it does for soap, tinned soup, and so on. > >From personal experience, I have read many papers from different universities, but for most of them, I don't know what their logomark or logotype looks like. I don't even know if they have one. But one has to be aware that an individual is not people. A university needs branding in general because they do things in addition to research. For a "mere human", the brand is probably the association one has with a university more than their faculty. In short: make sure you don't fall for selection bias. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfredlund@REDACTED Wed Jul 5 15:16:34 2017 From: lfredlund@REDACTED (=?UTF-8?Q?Lars-=c3=85ke_Fredlund?=) Date: Wed, 5 Jul 2017 15:16:34 +0200 Subject: [erlang-questions] Off-topic question about Universities In-Reply-To: <73bba216-8541-5326-6518-4918f5c7e286@ninenines.eu> References: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> <73bba216-8541-5326-6518-4918f5c7e286@ninenines.eu> Message-ID: <5c45a72a-4ebb-886d-9d66-78acc950eff6@fi.upm.es> And obviously, in the context of the Erlang world, the University of Otago is known for the famous Richard A. O'Keefe :-) So maybe you could suggest to your Vice-Chancellor a contextual combined logo targeted towards computer science/computer industry which includes the general university logo and a picture of your face. Please let me know his/her reaction to your suggestion :-) /Lars-Ake On 05/07/17 11:51, Lo?c Hoguin wrote: > You missed the keyword *visual*. Images are very persuasive and > they're one important aspect of a brand. It's not the entire > representation of a brand, however. > > I would argue that famous alumnees are a more important image for a > University brand. If your University was creating the Bill Gates and > Warren Buffet(s) of the world, you'd probably want a picture of them > instead of your logo. > > Otherwise, a University has little more imagery than its logo, and > perhaps a few landmarks. So he's not incorrect in his statement. > > On 07/05/2017 03:20 AM, Richard A. O'Keefe wrote: >> My University is about to go through a process of redesigning its logo. >> I'm interested in whether having a logo, a "brand", actually matters >> for a University. Obviously it does for soap, tinned soup, and so on. >> >> Some of you are at Universities, and some of you are at companies that >> hire graduates from Universities, and some of you are graduates from >> Universities or considering (further) study. So there should be some >> overlap with the target audience of a logo. >> >> So I was wondering if anyone had any strong opinions about Universities >> and logos, and better yet, any evidence. >> >> According to the Vice-Chancellor, >> >> The University logo is the most prominent visual aspect of >> the overarching University brand. Continuity and consistency >> of logo use is the most valuable asset a brand has. >> This is what builds recognition and awareness for an organisation, >> it is the foundation on which the visual identification of >> the University is built. >> >> You might be as surprised as I was that reputation, quality, price, >> published research, patents, and so on are not as valuable to a >> University brand as a logo. You might also be surprised that >> visual recognition of a University is so important. (Imagine >> the Prime Minister at the supermarket. "I'll have a kilo of >> University of Otago, please. No, not that. That's the logo >> with an *open* book, I want the one with the *closed* book.") >> Well, I guess I'll never be smart enough to be a VC. >> >> You might also be puzzled that if "Continuity and consistency >> of logo use is the most valuable asset a brand has" introducing >> discontinuity and inconsistency by changing the logo could >> ever be desirable. If so, you have overdosed on the Logic pills. >> I know I have! >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > From max.lapshin@REDACTED Wed Jul 5 15:19:31 2017 From: max.lapshin@REDACTED (Max Lapshin) Date: Wed, 5 Jul 2017 16:19:31 +0300 Subject: [erlang-questions] Zotonic - becoming OTP apps In-Reply-To: <84807B12-E2F4-41DE-A16E-8FE774D6D3AA@worrell.nl> References: <84807B12-E2F4-41DE-A16E-8FE774D6D3AA@worrell.nl> Message-ID: Very interesting! You will extract subparts as libraries? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Wed Jul 5 15:26:53 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Wed, 05 Jul 2017 13:26:53 +0000 Subject: [erlang-questions] ETS performance visualisation In-Reply-To: References: Message-ID: On Wed, Jul 5, 2017 at 12:46 PM Kacper Mentel wrote: - mean acces time to the table in a unit of time > > This is a pet-peeve of mine: the mean access time is often misleading, and usually completely wrong. 1. You can only use the mean for anything once you know the statistical model in which the data fits. Say we *assume* the data is normally distributed. Then we can use the mean for something as long as we also report the variance. But a general rule of computer science is that data is rarely normally distributed. It is much more common that data is (bi-)modal: there is a fast case, and then a slow code path for some pathological case. Thus, any mention of the mean will report a number in between the fast and slow class: there will be no data here! 2. Reporting the median (50th percentile) is slightly better. But it signals "I don't care for half of my customers" in the sense you ignore half of the requests. I'm far more interested in the 90th, 95th, 99th, 99.9th, 99.99th, 99.999th, percentiles and the maximal value than the mean for anything I do. Tracking this is easily done with HdrHistogram (see Gil Tene's work - the idea is to make histogram buckets follow the structure of a floating point number representation with exponent and mantissa which keeps the resolution high around 0.0). 3. I'm interested in a histogram over the latencies. But since histograms require you to come up with the size of the bars, a kernel density plot is almost always what I go after for these. One of the interesting things I've found is that if you plot the above, the conclusions tend to change quite a lot. For instance that the algorithm which is *really* fast in the common case is *really* slow when it hits the slow path. It may be so slow it is unusable. But if you report the mean, the system can "hide" the slow query by amortizing it over the fast ones. I don't find this to be fair. Another takeaway is that improving the 99th percentile tend to improve the latency curve for the system as a whole. ETS is a system in which lookups should not take more than 1-2 microseconds. But this means it should also hold for the 99.99th percentile. Finally, I have a hunch the {read_concurrency, true} options will have a far greater impact on parallel access to the table if you have a high amount of cores. Reporting the mean would allow the system to "hide" that it is stalling one core. Aside: If you haven't, your work should have a section which describes how the test cases work around the problem of "coordinated omission" in which the test generator coordinates with the system to hide request latencies which are really higher than what they should be. Have fun working on the project! Take or leave the above suggestions as you see fit! -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc@REDACTED Wed Jul 5 15:28:01 2017 From: marc@REDACTED (Marc Worrell) Date: Wed, 5 Jul 2017 15:28:01 +0200 Subject: [erlang-questions] Zotonic - becoming OTP apps In-Reply-To: References: <84807B12-E2F4-41DE-A16E-8FE774D6D3AA@worrell.nl> Message-ID: <17002556-5E29-4C1C-8172-393A1B0755AB@worrell.nl> Yes, we made a single umbrella project with all parts in ?apps/?. Those parts will be published as separate Hex packages. Then we will add some example projects to show how to make your own Zotonic project or include it in another project. - Marc > On 05 Jul 2017, at 15:19, Max Lapshin wrote: > > Very interesting! > > You will extract subparts as libraries? From jesper.louis.andersen@REDACTED Wed Jul 5 15:29:43 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Wed, 05 Jul 2017 13:29:43 +0000 Subject: [erlang-questions] Off-topic question about Universities In-Reply-To: <5c45a72a-4ebb-886d-9d66-78acc950eff6@fi.upm.es> References: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> <73bba216-8541-5326-6518-4918f5c7e286@ninenines.eu> <5c45a72a-4ebb-886d-9d66-78acc950eff6@fi.upm.es> Message-ID: Excellent idea! It reminds me of Peter J. Weinberger: http://spinroot.com/pico/pjw.html and I think the brand should contain the face of Richard A. O'Keefe in the same spirit. On Wed, Jul 5, 2017 at 3:17 PM Lars-?ke Fredlund wrote: > And obviously, in the context of the Erlang world, the University of > Otago is known for the famous Richard A. O'Keefe :-) > > So maybe you could suggest to your Vice-Chancellor a contextual combined > logo targeted towards computer science/computer industry which includes > the general university logo and a picture of your face. Please let me > know his/her reaction to your suggestion :-) > > /Lars-Ake > > > On 05/07/17 11:51, Lo?c Hoguin wrote: > > You missed the keyword *visual*. Images are very persuasive and > > they're one important aspect of a brand. It's not the entire > > representation of a brand, however. > > > > I would argue that famous alumnees are a more important image for a > > University brand. If your University was creating the Bill Gates and > > Warren Buffet(s) of the world, you'd probably want a picture of them > > instead of your logo. > > > > Otherwise, a University has little more imagery than its logo, and > > perhaps a few landmarks. So he's not incorrect in his statement. > > > > On 07/05/2017 03:20 AM, Richard A. O'Keefe wrote: > >> My University is about to go through a process of redesigning its logo. > >> I'm interested in whether having a logo, a "brand", actually matters > >> for a University. Obviously it does for soap, tinned soup, and so on. > >> > >> Some of you are at Universities, and some of you are at companies that > >> hire graduates from Universities, and some of you are graduates from > >> Universities or considering (further) study. So there should be some > >> overlap with the target audience of a logo. > >> > >> So I was wondering if anyone had any strong opinions about Universities > >> and logos, and better yet, any evidence. > >> > >> According to the Vice-Chancellor, > >> > >> The University logo is the most prominent visual aspect of > >> the overarching University brand. Continuity and consistency > >> of logo use is the most valuable asset a brand has. > >> This is what builds recognition and awareness for an organisation, > >> it is the foundation on which the visual identification of > >> the University is built. > >> > >> You might be as surprised as I was that reputation, quality, price, > >> published research, patents, and so on are not as valuable to a > >> University brand as a logo. You might also be surprised that > >> visual recognition of a University is so important. (Imagine > >> the Prime Minister at the supermarket. "I'll have a kilo of > >> University of Otago, please. No, not that. That's the logo > >> with an *open* book, I want the one with the *closed* book.") > >> Well, I guess I'll never be smart enough to be a VC. > >> > >> You might also be puzzled that if "Continuity and consistency > >> of logo use is the most valuable asset a brand has" introducing > >> discontinuity and inconsistency by changing the logo could > >> ever be desirable. If so, you have overdosed on the Logic pills. > >> I know I have! > >> > >> > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-questions > >> > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc@REDACTED Wed Jul 5 15:32:56 2017 From: marc@REDACTED (Marc Worrell) Date: Wed, 5 Jul 2017 15:32:56 +0200 Subject: [erlang-questions] Zotonic - becoming OTP apps In-Reply-To: <17002556-5E29-4C1C-8172-393A1B0755AB@worrell.nl> References: <84807B12-E2F4-41DE-A16E-8FE774D6D3AA@worrell.nl> <17002556-5E29-4C1C-8172-393A1B0755AB@worrell.nl> Message-ID: Though we have a problem with defining proper dependencies between the ?apps?. This is an issue the rebar3 people are looking into. https://github.com/erlang/rebar3/pull/1559 - Marc > On 05 Jul 2017, at 15:28, Marc Worrell wrote: > > Yes, we made a single umbrella project with all parts in ?apps/?. > Those parts will be published as separate Hex packages. > > Then we will add some example projects to show how to make your > own Zotonic project or include it in another project. > > - Marc > > >> On 05 Jul 2017, at 15:19, Max Lapshin wrote: >> >> Very interesting! >> >> You will extract subparts as libraries? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From mahesh@REDACTED Wed Jul 5 15:36:42 2017 From: mahesh@REDACTED (Mahesh Paolini-Subramanya) Date: Wed, 5 Jul 2017 08:36:42 -0500 Subject: [erlang-questions] Off-topic question about Universities In-Reply-To: References: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> <73bba216-8541-5326-6518-4918f5c7e286@ninenines.eu> <5c45a72a-4ebb-886d-9d66-78acc950eff6@fi.upm.es> Message-ID: 10 minutes of googling resulted in ? Number of articles, papers, studies, etc. on brand recognition in various contexts (Pepsi. IBM. etc.) --> ? (ok. close, but not quite) ? Number of the same pertaining to University brands (Notre Dame. Spartans. etc.) --> ? (same order of infinity) ? Number of the same pertaining to University *Logos* --> 0 (literally. zero.) Sez. everything right there... cheers On Wed, Jul 5, 2017 at 8:29 AM, Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > Excellent idea! > > It reminds me of Peter J. Weinberger: > > http://spinroot.com/pico/pjw.html > > and I think the brand should contain the face of Richard A. O'Keefe in the > same spirit. > > On Wed, Jul 5, 2017 at 3:17 PM Lars-?ke Fredlund > wrote: > >> And obviously, in the context of the Erlang world, the University of >> Otago is known for the famous Richard A. O'Keefe :-) >> >> So maybe you could suggest to your Vice-Chancellor a contextual combined >> logo targeted towards computer science/computer industry which includes >> the general university logo and a picture of your face. Please let me >> know his/her reaction to your suggestion :-) >> >> /Lars-Ake >> >> >> On 05/07/17 11:51, Lo?c Hoguin wrote: >> > You missed the keyword *visual*. Images are very persuasive and >> > they're one important aspect of a brand. It's not the entire >> > representation of a brand, however. >> > >> > I would argue that famous alumnees are a more important image for a >> > University brand. If your University was creating the Bill Gates and >> > Warren Buffet(s) of the world, you'd probably want a picture of them >> > instead of your logo. >> > >> > Otherwise, a University has little more imagery than its logo, and >> > perhaps a few landmarks. So he's not incorrect in his statement. >> > >> > On 07/05/2017 03:20 AM, Richard A. O'Keefe wrote: >> >> My University is about to go through a process of redesigning its logo. >> >> I'm interested in whether having a logo, a "brand", actually matters >> >> for a University. Obviously it does for soap, tinned soup, and so on. >> >> >> >> Some of you are at Universities, and some of you are at companies that >> >> hire graduates from Universities, and some of you are graduates from >> >> Universities or considering (further) study. So there should be some >> >> overlap with the target audience of a logo. >> >> >> >> So I was wondering if anyone had any strong opinions about Universities >> >> and logos, and better yet, any evidence. >> >> >> >> According to the Vice-Chancellor, >> >> >> >> The University logo is the most prominent visual aspect of >> >> the overarching University brand. Continuity and consistency >> >> of logo use is the most valuable asset a brand has. >> >> This is what builds recognition and awareness for an organisation, >> >> it is the foundation on which the visual identification of >> >> the University is built. >> >> >> >> You might be as surprised as I was that reputation, quality, price, >> >> published research, patents, and so on are not as valuable to a >> >> University brand as a logo. You might also be surprised that >> >> visual recognition of a University is so important. (Imagine >> >> the Prime Minister at the supermarket. "I'll have a kilo of >> >> University of Otago, please. No, not that. That's the logo >> >> with an *open* book, I want the one with the *closed* book.") >> >> Well, I guess I'll never be smart enough to be a VC. >> >> >> >> You might also be puzzled that if "Continuity and consistency >> >> of logo use is the most valuable asset a brand has" introducing >> >> discontinuity and inconsistency by changing the logo could >> >> ever be desirable. If so, you have overdosed on the Logic pills. >> >> I know I have! >> >> >> >> >> >> _______________________________________________ >> >> erlang-questions mailing list >> >> erlang-questions@REDACTED >> >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> > >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- *Mahesh Paolini-Subramanya That tall bald Indian guy..* *Twitter | Blog | G+ | LinkedIn * -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Wed Jul 5 15:38:41 2017 From: max.lapshin@REDACTED (Max Lapshin) Date: Wed, 5 Jul 2017 16:38:41 +0300 Subject: [erlang-questions] Zotonic - becoming OTP apps In-Reply-To: References: <84807B12-E2F4-41DE-A16E-8FE774D6D3AA@worrell.nl> <17002556-5E29-4C1C-8172-393A1B0755AB@worrell.nl> Message-ID: You are really brave! It is a very hard task to maintain such project. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc@REDACTED Wed Jul 5 15:46:08 2017 From: marc@REDACTED (Marc Worrell) Date: Wed, 5 Jul 2017 15:46:08 +0200 Subject: [erlang-questions] Zotonic - becoming OTP apps In-Reply-To: References: <84807B12-E2F4-41DE-A16E-8FE774D6D3AA@worrell.nl> <17002556-5E29-4C1C-8172-393A1B0755AB@worrell.nl> Message-ID: <310DBD71-AF1D-4BCA-9712-5751D67A1B99@worrell.nl> We have active support from quite some companies. Especially Driebit, Maximonster, and Channel.me are dedicating employee time. Thanks to their support we can maintain and make Zotonic better. - Marc > On 05 Jul 2017, at 15:38, Max Lapshin wrote: > > You are really brave! > > It is a very hard task to maintain such project. From mononcqc@REDACTED Wed Jul 5 15:51:36 2017 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 5 Jul 2017 09:51:36 -0400 Subject: [erlang-questions] Off-topic question about Universities In-Reply-To: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> References: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> Message-ID: On Tue, Jul 4, 2017 at 9:20 PM, Richard A. O'Keefe wrote: > > The University logo is the most prominent visual aspect of > the overarching University brand. Continuity and consistency > of logo use is the most valuable asset a brand has. > This is what builds recognition and awareness for an organisation, > it is the foundation on which the visual identification of > the University is built. A lot of other comments are correct in that in terms of overall brand, the logo is not necessarily doing much in the case of a university. Logos are deadly important in industries related to fashion, since in that case, clothing is not copyrightable, but by plastering your logo on garment, you make the design protected by trademarks instead. No such thing really happens in universities, and as mentioned before, publications or alumni play what I'd believe to be a much bigger role. In terms of visual branding though, the logo tends to come with a specific style and a limited set of colors; the style and those colors will usually be those that are chosen to pick the colors and influence the design of everything related to digital media (website, watermarking, mailing lists, ads, etc.), print media (fliers, forms, business cards), or general advertisement. So when it comes to a visual identity, the logo is often a linchpin that impacts all the other aspects of the identity. Maintaining continuity in style and/or color schemes means a lot less work needs to be re-done in other aspects of the overall marketing plan. Whether that work is impactful or not on the actual brand, or whether it is its "most valuable asset" on the reputation of the university is very arguable, but it is a significant amount of work (with a significant amount of money attached to it) nonetheless. To me it sounds like the Vice-Chancellor is overplaying the importance it has on reputation and brand as a whole, but the treasurer could reasonably make the case that it is very important when it comes to branding-related expenses. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Catenacci@REDACTED Wed Jul 5 16:07:20 2017 From: Catenacci@REDACTED (Onorio Catenacci) Date: Wed, 5 Jul 2017 10:07:20 -0400 Subject: [erlang-questions] wxErlang Message-ID: Hi Joe, I've been following your thread about wxErlang with some interest. It occurs to me that part of the reason that OO became so associated with pathological sharing of state is the fact that the main use case for OO initially was building UI's which are inherently extremely stateful. Of course, that's a somewhat 1/2 baked assertion--not based on evidence or scientific inquiry. At any rate, I look forward to hearing what you've found out about wxErlang! -- Onorio Catenacci http://onor.io http://www.google.com/+OnorioCatenacci -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Wed Jul 5 16:58:59 2017 From: erlang@REDACTED (Joe Armstrong) Date: Wed, 5 Jul 2017 16:58:59 +0200 Subject: [erlang-questions] wxErlang In-Reply-To: References: Message-ID: On Wed, Jul 5, 2017 at 4:07 PM, Onorio Catenacci wrote: > Hi Joe, > > I've been following your thread about wxErlang with some interest. It > occurs to me that part of the reason that OO became so associated with > pathological sharing of state is the fact that the main use case for OO > initially was building UI's which are inherently extremely stateful. Of > course, that's a somewhat 1/2 baked assertion--not based on evidence or > scientific inquiry. Actually they are inherently concurrent - you can think of toggle buttons as processes with state - you can think of a multi-paned window as a set of concurrent processes where each pane is represented by a process. The problem is that representing concurrency in sequential languages is a nightmare. The OO/GUI solution of zillions of callbacks is just one gigantic mess. As soon as you view the component parts of a GUI as a set of communications processes every becomes easy. To create a button within an object you send the object a message to add a button to the object. When you click on a button, it sends a message to somebody - this is very easy to model and understand. Smalltalk talked about "sending messages to objects" (as does objective C) but in fact they were not messages (in the Erlang sense) but were synchronous function calls Which for some reason were called methods. The abstract model of OO was based on the ideas of - encapsulation of state - polymorphic messaging (for example all objects might understand a printMe message) So it was very nice to describe (say) a button as "a thing that sends a message to something when you click it" The reality is "a button is something that triggers a synchronous callback and heaven help you if the code in the callback crashes, or takes a long time" Asynchronous message passing decouples the sender and receiver in a nice way - but there is no such decoupling in a purely synchronous system. The problem with wxErlang is that it faithfully reproduces the semantics of wxWidgets - but we can do better. We can arrange that a button callback really does just send a message. A long time ago I wrote ex11 a GUI thing for X-windows - it was pure message passing since X-windows can be controlled just be sending messages to port 8000 - it was very simple once the basic abstractions were set up. My goal is a GUI that can be entirely built and controlled by sending it messages. Cheers /Joe > > At any rate, I look forward to hearing what you've found out about wxErlang! > > -- > Onorio Catenacci > > http://onor.io > http://www.google.com/+OnorioCatenacci > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From erlang@REDACTED Wed Jul 5 17:30:04 2017 From: erlang@REDACTED (Joe Armstrong) Date: Wed, 5 Jul 2017 17:30:04 +0200 Subject: [erlang-questions] Off-topic question about Universities In-Reply-To: References: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> Message-ID: I went to a very entertaining lecture about branding. One of the big-name brands (I won't repeat it here) wanted to establish a YouTube presence - they were getting zero love on YouTube and were worried about this - they wanted some impact on "social media". So they hired a creative-director, a team of script writers and actors and made a 90 second video - this cost several million dollars and was shown and approved by top management. After a month or so they were horrified to see that only 30K people had viewed their video. In the post-mortem they just didn't get it - how come some crazy kids with no media training, no creative director, no experience could make videos that 10+ million people viewed? Herein lies the problem - the corporate mindset wants "presence on social media" - I see this a lot but don't really understand what it means. I like Twitter - for example - one of the best things are the rapid witty interactions that take place - there can be a Tweet storm lasting 30 seconds - seeing the Tweets statically, somewhat later and out of context misses the point. Certain politicians, businesses and corporate entities feel they have to have a Twitter presence - so they blast out meaningless bullshit - which is actually a very funny self-parody - it's like the companies who make websites with regulated user forums and FAQs FAQ: 1. Is your product really as awesome as you say it is? Yes - in fact it's even better - all our users are very happy with the product. FAQ 2: I really love your product, for the money it's really good value. Yes - we are committed to delivering outstanding value to the customer, ... And then there are real product forums - where the users bitch about their problems :-) I'm sure the University of Otago could excel with a branding exercise: Q1: Is the University of Otago a great place delivering outstanding value to it's students? A1: U of O is committed to providing outstanding value to all our students - we excel in providing world class education and training led by our superb teams of internationally renowned teachers. We are committed to .... Cheers /Joe On Wed, Jul 5, 2017 at 3:51 PM, Fred Hebert wrote: > > On Tue, Jul 4, 2017 at 9:20 PM, Richard A. O'Keefe > wrote: >> >> >> The University logo is the most prominent visual aspect of >> the overarching University brand. Continuity and consistency >> of logo use is the most valuable asset a brand has. >> This is what builds recognition and awareness for an organisation, >> it is the foundation on which the visual identification of >> the University is built. > > > > A lot of other comments are correct in that in terms of overall brand, the > logo is not necessarily doing much in the case of a university. Logos are > deadly important in industries related to fashion, since in that case, > clothing is not copyrightable, but by plastering your logo on garment, you > make the design protected by trademarks instead. No such thing really > happens in universities, and as mentioned before, publications or alumni > play what I'd believe to be a much bigger role. > > In terms of visual branding though, the logo tends to come with a specific > style and a limited set of colors; the style and those colors will usually > be those that are chosen to pick the colors and influence the design of > everything related to digital media (website, watermarking, mailing lists, > ads, etc.), print media (fliers, forms, business cards), or general > advertisement. > > So when it comes to a visual identity, the logo is often a linchpin that > impacts all the other aspects of the identity. Maintaining continuity in > style and/or color schemes means a lot less work needs to be re-done in > other aspects of the overall marketing plan. Whether that work is impactful > or not on the actual brand, or whether it is its "most valuable asset" on > the reputation of the university is very arguable, but it is a significant > amount of work (with a significant amount of money attached to it) > nonetheless. > > To me it sounds like the Vice-Chancellor is overplaying the importance it > has on reputation and brand as a whole, but the treasurer could reasonably > make the case that it is very important when it comes to branding-related > expenses. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From lloyd@REDACTED Wed Jul 5 21:40:32 2017 From: lloyd@REDACTED (lloyd@REDACTED) Date: Wed, 5 Jul 2017 15:40:32 -0400 (EDT) Subject: [erlang-questions] Off-topic question about Universities In-Reply-To: References: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> Message-ID: <1499283632.060914531@apps.rackspace.com> Ask your students, faculty, administration, alumni, and community, Richard, the first words and feelings that come to mind when you mention the name of your university. That's your university's brand. If those words and feelings are predominantly positive, e.g. motivate students to apply, alumni to donate, community to confer tax breaks, etc.,then how do you communicate those values quickly on a sign, letterhead, proposal, or tee-shirt? A logo has no intrinsic meaning beyond the associations people have when exposed to it. If I know nothing about your institution, a well-crafted logo may convey a sense of the values that the recruiters and fund-raisers in your institution would like me to associate with your institution through typography, shape, and color alone. But if I have experience with your institution, the logo will simply reinforce the positive or negative associations I have lurking in the back of my mind. Over time and the cumulative interactions and experiences many people have with your institution, your logo takes on significantly weighted symbolic value. It becomes invaluable in and of itself. Harvard University aggressively enforces proprietary rights to it's logo. Thus, think of your logo as the key to a cognitive/emotional value--- a short-hand designator or stand-in for your brand. When you commission a graphic designer to create a logo, you're asking the designers to combine visual elements of type, shape, and color into a highly-compressed image that brings to mind the good feelings you'd like folks to have toward you institution. If the image projected by your newly-minted logo are truly congruent with your established brand, then it's successful. If not, it will fail. If you have a great university, but the wider community fails to understand how good you really are--- that is, student recruitment is not up to potential, fund-raising falls, short, good faculty candidates choose other schools, then your university has a marketing problem. A logo alone will not solve your marketing problem. But it can contribute toward the success of a well-conceived and executed marketing campaign. The question is how much time and money should go into creating the logo vs. how much toward crafting and executing the larger campaign. You might as your administrator just exactly what problem he's attempting to solve and what else he is doing to solve it? All the best, LRP -----Original Message----- From: "Joe Armstrong" Sent: Wednesday, July 5, 2017 11:30am To: "Fred Hebert" Cc: "Erlang" Subject: Re: [erlang-questions] Off-topic question about Universities I went to a very entertaining lecture about branding. One of the big-name brands (I won't repeat it here) wanted to establish a YouTube presence - they were getting zero love on YouTube and were worried about this - they wanted some impact on "social media". So they hired a creative-director, a team of script writers and actors and made a 90 second video - this cost several million dollars and was shown and approved by top management. After a month or so they were horrified to see that only 30K people had viewed their video. In the post-mortem they just didn't get it - how come some crazy kids with no media training, no creative director, no experience could make videos that 10+ million people viewed? Herein lies the problem - the corporate mindset wants "presence on social media" - I see this a lot but don't really understand what it means. I like Twitter - for example - one of the best things are the rapid witty interactions that take place - there can be a Tweet storm lasting 30 seconds - seeing the Tweets statically, somewhat later and out of context misses the point. Certain politicians, businesses and corporate entities feel they have to have a Twitter presence - so they blast out meaningless bullshit - which is actually a very funny self-parody - it's like the companies who make websites with regulated user forums and FAQs FAQ: 1. Is your product really as awesome as you say it is? Yes - in fact it's even better - all our users are very happy with the product. FAQ 2: I really love your product, for the money it's really good value. Yes - we are committed to delivering outstanding value to the customer, ... And then there are real product forums - where the users bitch about their problems :-) I'm sure the University of Otago could excel with a branding exercise: Q1: Is the University of Otago a great place delivering outstanding value to it's students? A1: U of O is committed to providing outstanding value to all our students - we excel in providing world class education and training led by our superb teams of internationally renowned teachers. We are committed to .... Cheers /Joe On Wed, Jul 5, 2017 at 3:51 PM, Fred Hebert wrote: > > On Tue, Jul 4, 2017 at 9:20 PM, Richard A. O'Keefe > wrote: >> >> >> The University logo is the most prominent visual aspect of >> the overarching University brand. Continuity and consistency >> of logo use is the most valuable asset a brand has. >> This is what builds recognition and awareness for an organisation, >> it is the foundation on which the visual identification of >> the University is built. > > > > A lot of other comments are correct in that in terms of overall brand, the > logo is not necessarily doing much in the case of a university. Logos are > deadly important in industries related to fashion, since in that case, > clothing is not copyrightable, but by plastering your logo on garment, you > make the design protected by trademarks instead. No such thing really > happens in universities, and as mentioned before, publications or alumni > play what I'd believe to be a much bigger role. > > In terms of visual branding though, the logo tends to come with a specific > style and a limited set of colors; the style and those colors will usually > be those that are chosen to pick the colors and influence the design of > everything related to digital media (website, watermarking, mailing lists, > ads, etc.), print media (fliers, forms, business cards), or general > advertisement. > > So when it comes to a visual identity, the logo is often a linchpin that > impacts all the other aspects of the identity. Maintaining continuity in > style and/or color schemes means a lot less work needs to be re-done in > other aspects of the overall marketing plan. Whether that work is impactful > or not on the actual brand, or whether it is its "most valuable asset" on > the reputation of the university is very arguable, but it is a significant > amount of work (with a significant amount of money attached to it) > nonetheless. > > To me it sounds like the Vice-Chancellor is overplaying the importance it > has on reputation and brand as a whole, but the treasurer could reasonably > make the case that it is very important when it comes to branding-related > expenses. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From raould@REDACTED Wed Jul 5 21:56:54 2017 From: raould@REDACTED (Raoul Duke) Date: Wed, 5 Jul 2017 15:56:54 -0400 Subject: [erlang-questions] wxErlang In-Reply-To: References: Message-ID: I dare think the next hard part is coordination of all that state. It is no good to have async if it ends up with races where eg the toggle button (btw i consider toggle buttons to be a ux abomination most times $0.02) being the wrong state, or lagging significantly. -------------- next part -------------- An HTML attachment was scrubbed... URL: From list1@REDACTED Wed Jul 5 21:59:12 2017 From: list1@REDACTED (Grzegorz Junka) Date: Wed, 5 Jul 2017 19:59:12 +0000 Subject: [erlang-questions] wxErlang In-Reply-To: References: Message-ID: <4afaaf92-aa0a-3630-15ea-aea56a4384cc@gjunka.com> On 05/07/2017 14:58, Joe Armstrong wrote: > On Wed, Jul 5, 2017 at 4:07 PM, Onorio Catenacci wrote: >> Hi Joe, >> >> I've been following your thread about wxErlang with some interest. It >> occurs to me that part of the reason that OO became so associated with >> pathological sharing of state is the fact that the main use case for OO >> initially was building UI's which are inherently extremely stateful. Of >> course, that's a somewhat 1/2 baked assertion--not based on evidence or >> scientific inquiry. > Actually they are inherently concurrent - you can think of toggle > buttons as processes > with state - you can think of a multi-paned window as a set of > concurrent processes > where each pane is represented by a process. > > The problem is that representing concurrency in sequential languages > is a nightmare. > > The OO/GUI solution of zillions of callbacks is just one gigantic mess. > > As soon as you view the component parts of a GUI as a set of > communications processes > every becomes easy. > Actually I would argue that it's still a data representation issue. Even if buttons and panes can be represented by separate processes, it doesn't mean that the UI is concurrent. By saying that you assume that each process represents a part of the overall UI state. Then, yes, each part of that global state can be updated asynchronously and you need processes to guard those updates, so that only one update to that part of the state is processed at at time. But imagine that you extract the whole UI state into a separate object, i.e. Redux (a JavaScript library). You can update only one aspect of that global state at a time (using actions and reducers, according to Redux nomenclature). Then the problem is no longer asynchronous. Whenever the global state changes you use it to render the whole UI. Furthermore, I would argue that such a representation is better or more natural than representing the UI as independent processes. And that's precisely because it's not enough to know just parts of the global state to update the UI properly, you need to know the whole state. Consider how those buttons and panes should be rendered if parts of the UI overlap or sizes of some other parts of the UI change. Knowing the state of each overlapping or resized element wouldn't be enough. It's also important to know how those parts interact with each other. Grzegorz From ok@REDACTED Thu Jul 6 03:23:48 2017 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 6 Jul 2017 13:23:48 +1200 Subject: [erlang-questions] Off-topic question about Universities In-Reply-To: <1499283632.060914531@apps.rackspace.com> References: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> <1499283632.060914531@apps.rackspace.com> Message-ID: <7D2FF4EC-D194-43A6-8E73-2E5BEB5CF8CF@cs.otago.ac.nz> The thing is, we *have* a logo. http://www.otago.ac.nz/administration/service_divisions/external-engagement/otago017269.html More precisely, we have a portrait version, and a landscape version, each with colour (preferred) and black-and-white (allowed) variants. The logo contains the University crest, granted by the Lyon King of Arms in 1948. That's not about to change. The rest of the logo is words, the name of the University in English and M?ori (without which the crest would be unintelligible). The name of the University isn't about to change. So there's not much they *can* change. > On 6/07/2017, at 7:40 AM, wrote: > > Over time and the cumulative interactions and experiences many people have with your institution, your logo takes on significantly weighted symbolic value. It becomes invaluable in and of itself. Harvard University aggressively enforces proprietary rights to it's logo. Yes, but surely that is an argument for *not* changing the logo? I have been a student at two Universities and given lectures at four. Until yesterday, I couldn't have told you what any of their logos looked like. I see the logo on a van, let's say, and my brain goes "blob, University, stuff, probably a University vehicle then." > You might as your administrator just exactly what problem he's attempting to solve and what else he is doing to solve it? She. Downsizing Humanities, including some staff with seriously good international reputations. The latest fear is that 300 general staff may lose their jobs. If I'm reading the 2016 annual report correctly, the University had a surplus of NZD 21.377 million last year, up from NZD 16.143 million the year before. A professor of accounting, who co-authored a book with my father, told me about 40 years ago, "Richard, never go into business. You just don't think the right way for it." Clearly he was right. From ok@REDACTED Thu Jul 6 03:52:08 2017 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 6 Jul 2017 13:52:08 +1200 Subject: [erlang-questions] wxErlang In-Reply-To: References: Message-ID: <2A602218-ACE9-4A1E-A8F6-7DED357065F3@cs.otago.ac.nz> > On 6/07/2017, at 2:58 AM, Joe Armstrong wrote: > Actually they are inherently concurrent - you can think of toggle > buttons as processes > with state - you can think of a multi-paned window as a set of > concurrent processes > where each pane is represented by a process. Somebody wrote a GUI kit in Flat Concurrent Prolog (or some other committed choice concurrent logic programming language) in which he took exactly that approach. No objects, no inheritance, just hundreds of processes. Apparently it worked very well. I wish I could remember the guy's name. I mean, I _met_ him and saw the system in action. > > > When you click on a button, it sends a message to somebody - this is > very easy to model > and understand. Smalltalk talked about "sending messages to objects" > (as does objective C) > but in fact they were not messages (in the Erlang sense) but were > synchronous function calls > Which for some reason were called methods. There was some influence from Actors to Smalltalk. Selector = name of operation (think name/arity in Erlang). Method = code implemention operation (think function definition in Erlang). Message = procedure call *now*. Not originally. In the first version of Smalltalk, messages were actually deposited in a queue and an object would actively pull them out, not _entirely_ unlike receive. This was gradually optimised, but to this day "messages" are actually reified as objects under certain circumstances. For what it's worth, Smalltalk-80 was and modern Smalltalks (including my own) are concurrent programming languages, in which Processes can communicate via SharedQueues. When I open a ProcessBrowser in Squeak 4.4 (I really must upgrade) I see 7 processes running. Sadly, only one of them is the UI. > > The reality is "a button is something that triggers a synchronous > callback and heaven help you if > the code in the callback crashes, or takes a long time" Heh. There's worse. The Observer pattern in OOP is based on the dependency mechanism where an object that changed state could trigger calls to other interested objects. There are two later, more elaborate schemes: TriggerEvent and Announcements. At any rate, it's rather easy to get a cascade of event callbacks, and heaven help you if it's recursive! And you can get cyclic references between objects that require some care to disentangle when you want one of the objects to go away. > > > A long time ago I wrote ex11 a GUI thing for X-windows - it was pure > message passing since > X-windows can be controlled just be sending messages to port 8000 - it > was very simple > once the basic abstractions were set up. My favourite quote from the ex11 paper: "The first thing that happens when you see hello world written directly using Xlib is that you want to roll over and die." > My goal is a GUI that can be entirely built and controlled by sending > it messages. Is anyone maintaining ex11? From ok@REDACTED Thu Jul 6 04:08:47 2017 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 6 Jul 2017 14:08:47 +1200 Subject: [erlang-questions] wxErlang In-Reply-To: <4afaaf92-aa0a-3630-15ea-aea56a4384cc@gjunka.com> References: <4afaaf92-aa0a-3630-15ea-aea56a4384cc@gjunka.com> Message-ID: > On 6/07/2017, at 7:59 AM, Grzegorz Junka wrote: > > Furthermore, I would argue that such a representation is better or more natural than representing the UI as independent processes. Hmm. One of the web browsers I use is Chrome. Each Chrome window is managed by a separate process. For that matter, I see no great advantage from having the tabs in a window be in a single address space. My department has been doing a fair bit of work with sensor networks. If I have a window divided into panes showing the reports from say 10 sensors, why do I want that smushed into a single state? > And that's precisely because it's not enough to know just parts of the global state to update the UI properly, you need to know the whole state. You have an argument there for the *window manager* needing to know a lot for rendering onto the screen. After all, even ex11 routes all the messages for a display through a single socket. But that doesn't mean that the *application* is best structured as a giant state. Suppose I have an interface in which pressing a certain button starts an action that takes a long time, and I decide I want to stop it. - If the UI is completely synchronous, I have to wait until the action I want stopped is finished. - If the UI is concurrent, the "stop" button should always work. - If I'm using Swing, long-running actions are supposed to run in a different thread, but that means they can't update the UI. - If I'm using other things, I get the joy of using some sort of lame simulated concurrency. (This actually happened to me several times this week, and I had to resort to "Force Quit" each time.) From lloyd@REDACTED Thu Jul 6 05:36:40 2017 From: lloyd@REDACTED (Lloyd R. Prentice) Date: Wed, 5 Jul 2017 23:36:40 -0400 Subject: [erlang-questions] Off-topic question about Universities In-Reply-To: <7D2FF4EC-D194-43A6-8E73-2E5BEB5CF8CF@cs.otago.ac.nz> References: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> <1499283632.060914531@apps.rackspace.com> <7D2FF4EC-D194-43A6-8E73-2E5BEB5CF8CF@cs.otago.ac.nz> Message-ID: Hi Richard, I wouldn't discount your thinking on the matter. Changing the well-established logo of a well-regarded institution should not be undertaken lightly. You risk severing the long-established favorable associations, e.g. the symbolic value attached to your mark. It might be done to "freshen up" an image from stogy to contemporary and forward-looking, for instance, or to signal a change in vision or direction. Or it might be done to deflect from an unfavorable image, but that doesn't sound like the case with your university. But tradition is a compelling value for universities. At their best, universities provide a detached, considered, conservative (in the best sense of the word) perspective on the challenges of their host culture. They preserve and champion the best of the culture while, at the same time offering up new ideas and enriched knowledge to better understand and improve the human condition. In all regards, the widespread perception of stability is a virtue. I can't speak of European universities, but universities across the U.S. have had to cater to students who who are looking for little more than having their ticket punched for entry into the job market. Unfortunately, many politicians and business leaders see universities strictly through a business lens. How can they better train students to fill the needs of the current job market? How can university research better support the current perceived needs of business and government? This thinking gets translated into the notion that universities should be run like businesses--- trim the "fluff," offer more amenities and less rigor to students, reward the football coaches while paying adjunct faculty so little they need second and third jobs to support their families, empower the administration over faculty. It all comes down to the mission of your university. Until there's widespread consensus across all stakeholders re: what the university stands for and how it needs to adapt to a changing world, a new logo won't accomplish much and may, indeed, detract from other work that needs to be done. So, Richard, as a member of the faculty, it's quite appropriate for you to ask why you need a new logo and if it's the very best use of available funds. All the best, Lloyd Sent from my iPad > On Jul 5, 2017, at 9:23 PM, Richard A. O'Keefe wrote: > > The thing is, we *have* a logo. > http://www.otago.ac.nz/administration/service_divisions/external-engagement/otago017269.html > More precisely, we have a portrait version, and a landscape version, each with > colour (preferred) and black-and-white (allowed) variants. > > The logo contains the University crest, granted by the Lyon King of Arms in 1948. > That's not about to change. The rest of the logo is words, the name of the > University in English and M?ori (without which the crest would be unintelligible). > The name of the University isn't about to change. So there's not much they *can* > change. > >> On 6/07/2017, at 7:40 AM, wrote: >> >> Over time and the cumulative interactions and experiences many people have with your institution, your logo takes on significantly weighted symbolic value. It becomes invaluable in and of itself. Harvard University aggressively enforces proprietary rights to it's logo. > > Yes, but surely that is an argument for *not* changing the logo? > > I have been a student at two Universities and given lectures at four. > Until yesterday, I couldn't have told you what any of their logos looked like. > I see the logo on a van, let's say, and my brain goes "blob, University, stuff, > probably a University vehicle then." > >> You might as your administrator just exactly what problem he's attempting to solve and what else he is doing to solve it? > > She. Downsizing Humanities, including some staff with seriously good international > reputations. The latest fear is that 300 general staff may lose their jobs. > If I'm reading the 2016 annual report correctly, the University had a surplus > of NZD 21.377 million last year, up from NZD 16.143 million the year before. > > A professor of accounting, who co-authored a book with my father, told me > about 40 years ago, "Richard, never go into business. You just don't > think the right way for it." Clearly he was right. > From sashang@REDACTED Thu Jul 6 07:27:05 2017 From: sashang@REDACTED (Sashan Govender) Date: Thu, 06 Jul 2017 05:27:05 +0000 Subject: [erlang-questions] Off-topic question about Universities In-Reply-To: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> References: <3699ECBB-D4A5-4F0C-BD56-CF64D3F36595@cs.otago.ac.nz> Message-ID: Hi Richard Speaking as someone who attended NZ universities, in other words I was the customer, the last thing that crossed my mind was the universities logo. In fact it didn't cross my mind at all. For personal reasons I didn't have a choice when going to Massey Albany but after I finished there I could wanted to do an MSc and I picked Auckland because there were faculty who were teaching subject matter I was interested in. The logo had no influence. Criteria for me were 1) does it have the course I want and 2) who's teaching it and what's their reputation is in academic circles. As undergrads students look for courses that align with their interests and pick tertiary instituations that match. For postgrads it's the same plus they look at the faculty. Speaking as someone who occasionally interviews people the last thing I look for is the logo or the university. Maybe the logo matters more in other fields, but I'd rather hire people who can work things out and I can't determine that by looking at the logo next to the name of the university on a candidates CV/resume. On Wed, Jul 5, 2017 at 11:20 AM Richard A. O'Keefe wrote: > > According to the Vice-Chancellor, > > The University logo is the most prominent visual aspect of > the overarching University brand. Continuity and consistency > of logo use is the most valuable asset a brand has. > This is what builds recognition and awareness for an organisation, > it is the foundation on which the visual identification of > the University is built. > > You might be as surprised as I was that reputation, quality, price, > published research, patents, and so on are not as valuable to a > University brand as a logo. I'm as surprised as you. If Otago wants to change it's logo, I think it's a waste of money. In the future will they link the change of logo back to increased income somehow to justify changing it? Or will they say something like 'logos provide intangible value that we can't measure'. I mean if the VC can say now, at this point in time, that the logo has value, it means he can measure it, which means there should be a way to measure the return on value from changing it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank.muller.erl@REDACTED Thu Jul 6 09:56:36 2017 From: frank.muller.erl@REDACTED (Frank Muller) Date: Thu, 06 Jul 2017 07:56:36 +0000 Subject: [erlang-questions] wxErlang - some answers In-Reply-To: References: Message-ID: Joe, What about the idea behind "GTK server": http://www.gtk-server.org/ Best /Frank Le mar. 4 juil. 2017 ? 18:18, Joe Armstrong a ?crit : > I'm trying to get to grips with wxErlang so I toddled over to Ericsson > and sat down for a few hours with Dan Gudmundsson and asked him a boat > load of stupid questions. > > I'll be writing a lot more about this and setting up a github project > to document how to get tame wxErlang ... > > Here's a first attempt at figuring out how things work. > > My usual approach to understanding things is always the same. > > "Take a program that works. Then remove non-essential bits until > all that is left is so simple that you can understand it." > > How about making some buttons - this should be easy > > I started with demo.erl in ${ERL_TOP}/lib/wx/examples/demo/demo.erl > > This has some code for making buttons - but it also does *a lot more* > and *it is highly redundant* -- from the point of view of learning the > code volume does not assist comprehension, nor does using a generic > behavior. > > What do I mean by this? > > - ex_button.erl is written using wx_object.erl > so to understand ex_button.erl I have to also understand wx_object.erl > - ex_button.erl has repeated code. For example > several buttons have tooltips, but I only need to be shown how to do > this > *once* not several times > - ex_button.erl introduces several new concepts - in particular spacers > and sizers - and I haven't a clue what they do. > > Now I'm going to refactor ex_button.erl so take a deep breath ... > > First refactoring: remove the dependency on wx_object > > I'd already figured out that a *minimal* wx windows program is: > > start() -> > Wx = wx_win:new(), > Frame = wxFrame:new(Wx, -1, "Window Title"), > wxFrame:show(Frame). > > To make the window do something I'd want to write: > > start() -> > Wx = wx_win:new(), > Frame = wxFrame:new(Wx, -1, "Window Title"), > setup_window(Frame), > wxFrame:show(Frame), > loop(). > > loop() -> > receive > Any -> > io:format("Any=~p~n",[Any]) > end, > loop(). > > Given this structure I refactored ex_button.erl into buttons_demo.erl > which removes all the wx_object code. So now I can stare are the code > in buttons_demo.erl and see if I can understand it, for my point of > view it's far easier to understand than ex_buttons.erl since there is > no dependency on wx_object.erl > > Second refactoring: Simplify buttons_demo.erl > > The original program has four rows of buttons - but one will > be sufficient for me. > > I now removed many lines of code, until only one line of buttons > remained. > > The resulting code buttons_demo1.erl now only creates one line of buttons > and has a couple of sizers. > > Dan told me that the line of code: > > wxStaticBoxSizer:new(?wxHORIZONTAL, Panel,[{label, "wxButton"}]), > > Is wxWidgets way of making an hbox - Goodness wxWidgets can be build > using Knuthian hboxes and vboxes (horray). > > I'm still not happy with buttons_demo1.erl since it mixes two ideas: > > - making buttons > - putting buttons in a container and laying out the containers > > This needs to be refactored into: > > - a pure button examples > - a pure layout example > > My intention is to try and decompose wxErlang into a large number of > small examples, where each example illustrates one feature of the > system. Also so show how to build complex examples from the small > parts. > > I'll make all the code available on github so you can join in the fun > (is this fun?). > > Notes: > > [1] Feel free to send me examples of wxErlang code - preferably > one example per module that illustrates one feature. > > [2] Anybody want to do this for elixir? > > [3] The WxWidgets documentation is a terminological mess - they call > *everything* (including a button) a window. > > [4] The WxWidget examples (in C++) require subclassing several objects > resulting in multiple files per example - the Erlang equivalent is > nicely contained within a single module (which is far nicer) > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From list1@REDACTED Thu Jul 6 10:53:30 2017 From: list1@REDACTED (Grzegorz Junka) Date: Thu, 6 Jul 2017 08:53:30 +0000 Subject: [erlang-questions] wxErlang In-Reply-To: References: <4afaaf92-aa0a-3630-15ea-aea56a4384cc@gjunka.com> Message-ID: <8d436915-e325-069f-af13-e18e607083ca@gjunka.com> On 06/07/2017 02:08, Richard A. O'Keefe wrote: >> On 6/07/2017, at 7:59 AM, Grzegorz Junka wrote: >> >> Furthermore, I would argue that such a representation is better or more natural than representing the UI as independent processes. > Hmm. One of the web browsers I use is Chrome. Each Chrome window > is managed by a separate process. For that matter, I see no great > advantage from having the tabs in a window be in a single address > space. > > My department has been doing a fair bit of work with sensor networks. > If I have a window divided into panes showing the reports from say > 10 sensors, why do I want that smushed into a single state? You are adding an additional level of abstraction. Each tab is a separate UI and then the arrangement of all tabs/browsers on the screen is yet another UI. Surely, each UI requires a separate process because there is no shared state between them. But then again, there is no reason for the main UI (showing all the tabs) to be split into separate processes/states. You can of course optimize the rendering by extracting some calculations into separate threads so that the main rendering thread isn't being blocked by them. But it's an optimization not changing the fact that each UI is ultimately based on one state. >> And that's precisely because it's not enough to know just parts of the global state to update the UI properly, you need to know the whole state. > You have an argument there for the *window manager* needing to know > a lot for rendering onto the screen. After all, even ex11 routes > all the messages for a display through a single socket. But that > doesn't mean that the *application* is best structured as a giant > state. We are talking about the UI here, which is not the same as application. UI is the view of the application and the state of the UI is something separate to the state of the application. > Suppose I have an interface in which pressing a certain button > starts an action that takes a long time, and I decide I want to > stop it. > - If the UI is completely synchronous, I have to wait until the > action I want stopped is finished. > - If the UI is concurrent, the "stop" button should always work. > - If I'm using Swing, long-running actions are supposed to run > in a different thread, but that means they can't update the UI. > - If I'm using other things, I get the joy of using some sort of > lame simulated concurrency. > (This actually happened to me several times this week, and I had > to resort to "Force Quit" each time.) > You are mixing the UI with the application. The fact that UI is synchronous doesn't mean that the whole application needs to be synchronous. I am arguing that UI should be represented as a single process dependent on a single state, but that process shouldn't be the same as the main process of the application. The application runs as many independent processes (IO, data model, processing, etc). That's independent of the UI. When any data that needs to be displayed changes the application process communicates the change to the UI process which takes care of displaying that change correctly considering all other UI elements on the page that it knows about from the single UI state. Grzegorz From Aleksander.Nycz@REDACTED Thu Jul 6 11:41:34 2017 From: Aleksander.Nycz@REDACTED (Aleksander Nycz) Date: Thu, 6 Jul 2017 11:41:34 +0200 Subject: [erlang-questions] diameter server - overload protection In-Reply-To: References: Message-ID: Hello, We try to implement overload protection into diameter server that uses erlang diameter-2.0 application. Our overload policy use queuing time and queue lenght to determine if server is overloaded or not. Currently it is quite hard to check when diameter packet was received by diameter stack, so I would like to add to diameter_packet record (defined in diameter.hrl) receive_time field like this: -record(diameter_packet, {header,%% #diameter_header{} avps,%% deep list() of #diameter_avp{} msg,%% fully decoded message bin,%% binary received/sent over the wire errors = [],%% list() of Result-Code | {Result-Code, #diameter_avp{}} transport_data, *receive_time = erlang:monotonic_time() **%% integer()* }). What do you think about it? It will be possible to merge this into diameter app release with OTP 20.1? Best Regards Aleksander Nycz -- Aleksander Nycz Chief Designer Telco_021 BSS R&D Comarch SA Phone: +48 17 785 5909 Mobile: +48 691 464 275 website: www.comarch.pl -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4936 bytes Desc: Kryptograficzna sygnatura S/MIME URL: From anders.gs.svensson@REDACTED Thu Jul 6 12:16:40 2017 From: anders.gs.svensson@REDACTED (anders.gs.svensson@REDACTED) Date: Thu, 6 Jul 2017 12:16:40 +0200 Subject: [erlang-questions] diameter server - overload protection In-Reply-To: References: Message-ID: <22878.3592.424879.858382@gargle.gargle.HOWL> Hi Aleksander. Changing diameter_packet will create a fair deal of upgrade woe, but you can use a message_cb option to diameter_{tcp,sctp} to set the time in diameter_packet.transport_data. (None of which is documented yet, but probably in 20.1.) Anders erlang-questions-request@REDACTED writes: > Message: 10 > Date: Thu, 6 Jul 2017 11:41:34 +0200 > From: Aleksander Nycz > To: erlang-questions@REDACTED > Subject: [erlang-questions] diameter server - overload protection > Message-ID: > Content-Type: text/plain; charset="utf-8"; Format="flowed" > > Hello, > > > We try to implement overload protection into diameter server that uses > erlang diameter-2.0 application. > > Our overload policy use queuing time and queue lenght to determine if > server is overloaded or not. > > > Currently it is quite hard to check when diameter packet was received by > diameter stack, > > so I would like to add to diameter_packet record (defined in > diameter.hrl) receive_time field like this: > > -record(diameter_packet, > {header,%% #diameter_header{} avps,%% deep list() of #diameter_avp{} msg,%% fully decoded message bin,%% binary received/sent over the wire errors = [],%% list() of Result-Code | {Result-Code, #diameter_avp{}} transport_data, > *receive_time = erlang:monotonic_time() **%% integer()* }). > > > What do you think about it? > > It will be possible to merge this into diameter app release with OTP 20.1? > > > Best Regards > > Aleksander Nycz > > > -- > Aleksander Nycz > Chief Designer > Telco_021 BSS R&D > Comarch SA > Phone: +48 17 785 5909 > Mobile: +48 691 464 275 > website: www.comarch.pl From thor@REDACTED Thu Jul 6 12:26:20 2017 From: thor@REDACTED (Thor E. Lie) Date: Thu, 6 Jul 2017 12:26:20 +0200 (CEST) Subject: [erlang-questions] egd on OTP 20 Ubuntu 16.04 Message-ID: <1939553090.1208840377.1499336780891.JavaMail.zimbra@thorerik.com> Hi, I'm currently learning Elixir, and one of the things I'm touching on is creating images but I'm running into a quite major speedbump, egd is unavailable in both Elixir and Eshell. As a quick test I found the following[1] erlang program that use egd and compiled that via Eshell[2], where you can see egd:create/2 is unavailable. I've installed the erlang-percept package from the erlang-solutions repository[3], so as far as I understand it should be available. am I missing something? As for why OTP 20? That's what I get from the repo by default. -- Thor [1]: https://gist.github.com/thorerik/13a519a3e481ef235093165123ecf8a9 [2]: https://gist.github.com/thorerik/c360f59b59bff7a027e5e1d9c8d36019 [3]: https://gist.github.com/thorerik/c854f3da210b2acb0640c50b0dcfc35c From erlang@REDACTED Thu Jul 6 13:49:01 2017 From: erlang@REDACTED (Joe Armstrong) Date: Thu, 6 Jul 2017 13:49:01 +0200 Subject: [erlang-questions] wxErlang - some answers In-Reply-To: References: Message-ID: I'd forgotten about the GTK server - I played with it years ago - has anybody any experience with building this on various platforms? /Joe On Thu, Jul 6, 2017 at 9:56 AM, Frank Muller wrote: > Joe, > > What about the idea behind "GTK server": > http://www.gtk-server.org/ > > Best > /Frank > > Le mar. 4 juil. 2017 ? 18:18, Joe Armstrong a ?crit : >> >> I'm trying to get to grips with wxErlang so I toddled over to Ericsson >> and sat down for a few hours with Dan Gudmundsson and asked him a boat >> load of stupid questions. >> >> I'll be writing a lot more about this and setting up a github project >> to document how to get tame wxErlang ... >> >> Here's a first attempt at figuring out how things work. >> >> My usual approach to understanding things is always the same. >> >> "Take a program that works. Then remove non-essential bits until >> all that is left is so simple that you can understand it." >> >> How about making some buttons - this should be easy >> >> I started with demo.erl in ${ERL_TOP}/lib/wx/examples/demo/demo.erl >> >> This has some code for making buttons - but it also does *a lot more* >> and *it is highly redundant* -- from the point of view of learning the >> code volume does not assist comprehension, nor does using a generic >> behavior. >> >> What do I mean by this? >> >> - ex_button.erl is written using wx_object.erl >> so to understand ex_button.erl I have to also understand >> wx_object.erl >> - ex_button.erl has repeated code. For example >> several buttons have tooltips, but I only need to be shown how to do >> this >> *once* not several times >> - ex_button.erl introduces several new concepts - in particular spacers >> and sizers - and I haven't a clue what they do. >> >> Now I'm going to refactor ex_button.erl so take a deep breath ... >> >> First refactoring: remove the dependency on wx_object >> >> I'd already figured out that a *minimal* wx windows program is: >> >> start() -> >> Wx = wx_win:new(), >> Frame = wxFrame:new(Wx, -1, "Window Title"), >> wxFrame:show(Frame). >> >> To make the window do something I'd want to write: >> >> start() -> >> Wx = wx_win:new(), >> Frame = wxFrame:new(Wx, -1, "Window Title"), >> setup_window(Frame), >> wxFrame:show(Frame), >> loop(). >> >> loop() -> >> receive >> Any -> >> io:format("Any=~p~n",[Any]) >> end, >> loop(). >> >> Given this structure I refactored ex_button.erl into buttons_demo.erl >> which removes all the wx_object code. So now I can stare are the code >> in buttons_demo.erl and see if I can understand it, for my point of >> view it's far easier to understand than ex_buttons.erl since there is >> no dependency on wx_object.erl >> >> Second refactoring: Simplify buttons_demo.erl >> >> The original program has four rows of buttons - but one will >> be sufficient for me. >> >> I now removed many lines of code, until only one line of buttons >> remained. >> >> The resulting code buttons_demo1.erl now only creates one line of buttons >> and has a couple of sizers. >> >> Dan told me that the line of code: >> >> wxStaticBoxSizer:new(?wxHORIZONTAL, Panel,[{label, "wxButton"}]), >> >> Is wxWidgets way of making an hbox - Goodness wxWidgets can be build >> using Knuthian hboxes and vboxes (horray). >> >> I'm still not happy with buttons_demo1.erl since it mixes two ideas: >> >> - making buttons >> - putting buttons in a container and laying out the containers >> >> This needs to be refactored into: >> >> - a pure button examples >> - a pure layout example >> >> My intention is to try and decompose wxErlang into a large number of >> small examples, where each example illustrates one feature of the >> system. Also so show how to build complex examples from the small >> parts. >> >> I'll make all the code available on github so you can join in the fun >> (is this fun?). >> >> Notes: >> >> [1] Feel free to send me examples of wxErlang code - preferably >> one example per module that illustrates one feature. >> >> [2] Anybody want to do this for elixir? >> >> [3] The WxWidgets documentation is a terminological mess - they call >> *everything* (including a button) a window. >> >> [4] The WxWidget examples (in C++) require subclassing several objects >> resulting in multiple files per example - the Erlang equivalent is >> nicely contained within a single module (which is far nicer) >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From abhishek@REDACTED Thu Jul 6 14:26:09 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Thu, 6 Jul 2017 17:56:09 +0530 (IST) Subject: [erlang-questions] Problem running custom code in Multi-User-Chatroom Message-ID: <1152149694.61091.1499343970064@webmail.blacklightsw.com> I have written down the following hook to run a simple tic-tac-toe game using ejabberd -module(tic_hook). -behaviour(gen_mod). -export([start/2,stop/1,depends/2,mod_opt_type/1,myMessage/1]). -include("logger.hrl"). -include("xmpp.hrl"). -include("ejabberd.hrl"). -record(store_player_id1, {pid,name}). -record(store_player_id2, {pid,name}). -record(store_from,{from,to}). start(_Host, _Opts) -> ?INFO_MSG("Inside tic_hook start function ",[]), gameserver:start(), mnesia:create_table(store_player_id1, [{type, bag},{attributes, record_info(fields,store_player_id1)}]), mnesia:create_table(store_player_id2, [{type, bag},{attributes, record_info(fields,store_player_id2)}]), mnesia:create_table(store_from, [{type, bag},{attributes, record_info(fields,store_from)}]), ejabberd_hooks:add(user_send_packet, _Host, ?MODULE, myMessage, 95), ok. stop(_Host) -> mnesia:clear_table(store_player_id1), mnesia:clear_table(store_player_id2), mnesia:clear_table(store_from), ejabberd_hooks:delete(user_send_packet, _Host, ?MODULE, myMessage,95). depends(_Host, _Opts)->[{?MODULE,soft}]. mod_opt_type(_Option)-> []. myMessage({Packet, C2SState})-> PacketType=xmpp:get_name(Packet), case PacketType of <<"iq">>-> ok; <<"presence">>-> ok; <<"message">>-> CatchAll=[{'_',[],['$_']}], PidTabLIst1=mnesia:dirty_select(store_player_id1, CatchAll), PidTabLIst2=mnesia:dirty_select(store_player_id2, CatchAll), MessageSendingUserList=mnesia:dirty_select(store_from, CatchAll), Bin=xmpp:get_text(Packet#message.body), PL1Tuple=Packet#message.from, PL2Tuple=Packet#message.to, PL1Binary=element(2,PL1Tuple), PL2Binary=element(2,PL2Tuple), PL1=binary_to_list(PL1Binary), PL2=binary_to_list(PL2Binary), if (length(MessageSendingUserList)==0)-> T3 = fun() -> X3 = #store_from{from=PL1, to=PL2 }, mnesia:write(X3) end, mnesia:transaction(T3); (length(MessageSendingUserList)/=0)-> ok end, StrMessage=binary_to_list(Bin), Message=list_to_atom(StrMessage), if (Message==login)-> Player1 = gameclient:login(PL1), Player2 = gameclient:login(PL2), T1 = fun() -> X1 = #store_player_id1{pid=Player1, name=PL1 }, mnesia:write(X1) end, mnesia:transaction(T1), T2 = fun() -> X2 = #store_player_id2{pid=Player2, name=PL2 }, mnesia:write(X2) end, mnesia:transaction(T2), Player2, gameclient:new_game(Player1, PL2); (Message/=login)-> Player1=element(2,hd(PidTabLIst1)), Player2=element(2,hd(PidTabLIst2)), ChallengingPlayer=element(2,hd(MessageSendingUserList)), ChallengedPlayer=element(3,hd(MessageSendingUserList)), if (PL1==ChallengingPlayer)-> ChallengedPlayer=element(3,hd(MessageSendingUserList)), gameclient:make_move(Player1, ChallengedPlayer, Message), timer:sleep(5); (PL1==ChallengedPlayer)-> ChallengingPlayer=element(2,hd(MessageSendingUserList)), gameclient:make_move(Player2, ChallengingPlayer, Message), timer:sleep(5) end end end, {Packet, C2SState}. .But this code only works in case of one to one chats. But when I tried running it on MUC room named 'room' I got the following output : 17:34:13.121 [error] Hook user_send_packet crashed when running test_hook:myMessage/1: ** Reason = {error,badarg,[{erlang,hd,[],[[]]},{test_hook,myMessage,[{file,"test_hook.erl"},{line,137}],1},{ejabberd_hooks,safe_apply,[{file,"src/ejabberd_hooks.erl"},{line,380}],4},{ejabberd_hooks,run_fold1,[{file,"src/ejabberd_hooks.erl"},{line,364}],4},{ejabberd_c2s,handle_authenticated_packet,[{file,"ejabberd_c2s.erl"},{line,472}],2},{xmpp_stream_in,process_authenticated_packet,[{file,"xmpp_stream_in.erl"},{line,594}],2},{xmpp_stream_in,handle_info,[{file,"xmpp_stream_in.erl"},{line,339}],2},{p1_server,handle_msg,[{file,"src/p1_server.erl"},{line,696}],8}]} ** Arguments = [{{message,<<"purple45192e38">>,groupchat,<<"en">>,{jid,<<"praveen">>,<<"casino.com">>,<<"-">>,<<"praveen">>,<<"casino.com">>,<<"-">>},{jid,<<"room">>,<<"conference.casino.com">>,<<>>,<<"room">>,<<"conference.casino.com">>,<<>>},[],[{text,<<>>,<<"a2">>}],undefined,[],#{ip => {127,0,0,1}}},#{csi_queue => {0,0,#{}},resource => <<"-">>,stream_compressed => false,mgmt_max_timeout => 300,lserver => <<"casino.com">>,stream_encrypted => true,stream_state => established,mgmt_resend => false,tls_verify => false,mgmt_ack_timeout => 60000,stream_authenticated => true,xmlns => <<"jabber:client">>,shaper => c2s_shaper,mgmt_stanzas_out => 0,auth_module => ejabberd_auth_sql,privacy_list => {userlist,none,[],false},mgmt_stanzas_req => 0,stream_direction => in,socket_monitor => #Ref<0.0.1.11300>,stream_header_sent => true,stream_timeout => infinity,pres_timestamp => {1499,342589,182000},zlib => false,server => <<"casino.com">>,tls_enabled => true,jid => {jid,<<"praveen">>,<<"ca sino.com">>,<<"-">>,<<"praveen">>,<<"casino.com">>,<<"-">>},ip => {{127,0,0,1},55611},access => c2s,caps_resources => {1,{{<<"praveen">>,<<"casino.com">>,<<"-">>},{caps,<<"http://pidgin.im/">>,<<"I22W7CegORwdbnu0ZiQwGpxr0Go=">>,<<"sha-1">>,[]},nil,nil}},tls_options => [compression_none,{protocol_options,<<"no_sslv3">>},{certfile,<<"C:\\ProgramData\\ejabberd\\conf\\server.pem">>}],pres_t => {1,{{<<"praveen">>,<<"casino.com">>,<<>>},nil,nil}},conn => c2s_tls,sockmod => ejabberd_socket,stream_id => <<"11446533041510383550">>,pres_f => {1,{{<<"praveen">>,<<"casino.com">>,<<>>},nil,nil}},user => <<"praveen">>,stream_restarted => true,mgmt_max_queue => 1000,mod => ejabberd_c2s,pres_a => {2,{{<<"praveen">>,<<"casino.com">>,<<>>},nil,{{<<"room">>,<<"conference.casino.com">>,<<"praveen">>},nil,nil}}},csi_state => active,owner => <0.506.0>,socket => {socket_state,fast_tls,{tlssock,#Port<0.23159>,#Port<0.23222>},<0.505.0>},mgmt_timeout => 300,sid => {{1499,342588,1},<0.506.0>},stream_v ersion => {1,0},mgmt_state => inactive,tls_required => false,lang => <<"en">>,pres_last => {presence,<<>>,available,<<"en">>,{jid,<<"praveen">>,<<"casino.com">>,<<"-">>,<<"praveen">>,<<"casino.com">>,<<"-">>},{jid,<<"praveen">>,<<"casino.com">>,<<>>,<<"praveen">>,<<"casino.com">>,<<>>},undefined,[{text,<<>>,<<"I like cricket">>}],1,[{xmlel,<<"c">>,[{<<"xmlns">>,<<"http://jabber.org/protocol/caps">>},{<<"node">>,<<"http://pidgin.im/">>},{<<"hash">>,<<"sha-1">>},{<<"ver">>,<<"I22W7CegORwdbnu0ZiQwGpxr0Go=">>}],[]},{xmlel,<<"x">>,[{<<"xmlns">>,<<"vcard-temp:x:update">>}],[{xmlel,<<"photo">>,[],[]}]}],#{ip => {127,0,0,1}}},mgmt_stanzas_in => 0}}] Can anybody guide me how to run the game on the MUC room also? -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhishek@REDACTED Thu Jul 6 14:32:12 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Thu, 6 Jul 2017 18:02:12 +0530 (IST) Subject: [erlang-questions] Problem running custom code in Multi-User-Chatroom In-Reply-To: <1152149694.61091.1499343970064@webmail.blacklightsw.com> References: <1152149694.61091.1499343970064@webmail.blacklightsw.com> Message-ID: <1027279655.61683.1499344332327@webmail.blacklightsw.com> Sorry By mistake I have asked the question in erlang mailing list, instead of ejabberd's mailing list. But if anyone can still help then please suggest something. Cheers!! Abhishek > On July 6, 2017 at 5:56 PM Abhishek Ranjan wrote: > > > I have written down the following hook to run a simple tic-tac-toe game using ejabberd > > > -module(tic_hook). > -behaviour(gen_mod). > > > -export([start/2,stop/1,depends/2,mod_opt_type/1,myMessage/1]). > -include("logger.hrl"). > -include("xmpp.hrl"). > -include("ejabberd.hrl"). > > -record(store_player_id1, {pid,name}). > -record(store_player_id2, {pid,name}). > -record(store_from,{from,to}). > > start(_Host, _Opts) -> > > ?INFO_MSG("Inside tic_hook start function ",[]), > gameserver:start(), > mnesia:create_table(store_player_id1, [{type, bag},{attributes, record_info(fields,store_player_id1)}]), > mnesia:create_table(store_player_id2, [{type, bag},{attributes, record_info(fields,store_player_id2)}]), > mnesia:create_table(store_from, [{type, bag},{attributes, record_info(fields,store_from)}]), > ejabberd_hooks:add(user_send_packet, _Host, ?MODULE, > myMessage, 95), > ok. > > > stop(_Host) -> > mnesia:clear_table(store_player_id1), > mnesia:clear_table(store_player_id2), > mnesia:clear_table(store_from), > ejabberd_hooks:delete(user_send_packet, _Host, ?MODULE, myMessage,95). > > depends(_Host, _Opts)->[{?MODULE,soft}]. > > mod_opt_type(_Option)-> > []. > > > myMessage({Packet, C2SState})-> > > PacketType=xmpp:get_name(Packet), > case PacketType of > > <<"iq">>-> > ok; > <<"presence">>-> > ok; > <<"message">>-> > > > CatchAll=[{'_',[],['$_']}], > PidTabLIst1=mnesia:dirty_select(store_player_id1, CatchAll), > PidTabLIst2=mnesia:dirty_select(store_player_id2, CatchAll), > MessageSendingUserList=mnesia:dirty_select(store_from, CatchAll), > Bin=xmpp:get_text(Packet#message.body), > PL1Tuple=Packet#message.from, > PL2Tuple=Packet#message.to, > PL1Binary=element(2,PL1Tuple), > PL2Binary=element(2,PL2Tuple), > PL1=binary_to_list(PL1Binary), > PL2=binary_to_list(PL2Binary), > > > > if > (length(MessageSendingUserList)==0)-> > T3 = fun() -> > X3 = #store_from{from=PL1, > to=PL2 > }, > mnesia:write(X3) > end, > mnesia:transaction(T3); > (length(MessageSendingUserList)/=0)-> > ok > end, > > StrMessage=binary_to_list(Bin), > Message=list_to_atom(StrMessage), > > > > if > (Message==login)-> > Player1 = gameclient:login(PL1), > > Player2 = gameclient:login(PL2), > T1 = fun() -> > X1 = #store_player_id1{pid=Player1, > name=PL1 > }, > mnesia:write(X1) > end, > mnesia:transaction(T1), > T2 = fun() -> > X2 = #store_player_id2{pid=Player2, > name=PL2 > }, > mnesia:write(X2) > end, > mnesia:transaction(T2), > Player2, > gameclient:new_game(Player1, PL2); > > (Message/=login)-> > Player1=element(2,hd(PidTabLIst1)), > Player2=element(2,hd(PidTabLIst2)), > ChallengingPlayer=element(2,hd(MessageSendingUserList)), > ChallengedPlayer=element(3,hd(MessageSendingUserList)), > > > > if > (PL1==ChallengingPlayer)-> > > > ChallengedPlayer=element(3,hd(MessageSendingUserList)), > gameclient:make_move(Player1, ChallengedPlayer, Message), > timer:sleep(5); > > (PL1==ChallengedPlayer)-> > > ChallengingPlayer=element(2,hd(MessageSendingUserList)), > gameclient:make_move(Player2, ChallengingPlayer, Message), > timer:sleep(5) > > end > end > end, > {Packet, C2SState}. > > > .But this code only works in case of one to one chats. > > > But when I tried running it on MUC room named 'room' I got the following output : > > 17:34:13.121 [error] Hook user_send_packet crashed when running test_hook:myMessage/1: > ** Reason = {error,badarg,[{erlang,hd,[],[[]]},{test_hook,myMessage,[{file,"test_hook.erl"},{line,137}],1},{ejabberd_hooks,safe_apply,[{file,"src/ejabberd_hooks.erl"},{line,380}],4},{ejabberd_hooks,run_fold1,[{file,"src/ejabberd_hooks.erl"},{line,364}],4},{ejabberd_c2s,handle_authenticated_packet,[{file,"ejabberd_c2s.erl"},{line,472}],2},{xmpp_stream_in,process_authenticated_packet,[{file,"xmpp_stream_in.erl"},{line,594}],2},{xmpp_stream_in,handle_info,[{file,"xmpp_stream_in.erl"},{line,339}],2},{p1_server,handle_msg,[{file,"src/p1_server.erl"},{line,696}],8}]} > > > ** Arguments = [{{message,<<"purple45192e38">>,groupchat,<<"en">>,{jid,<<"praveen">>,<<"casino.com">>,<<"-">>,<<"praveen">>,<<"casino.com">>,<<"-">>},{jid,<<"room">>,<<"conference.casino.com">>,<<>>,<<"room">>,<<"conference.casino.com">>,<<>>},[],[{text,<<>>,<<"a2">>}],undefined,[],#{ip => {127,0,0,1}}},#{csi_queue => {0,0,#{}},resource => <<"-">>,stream_compressed => false,mgmt_max_timeout => 300,lserver => <<"casino.com">>,stream_encrypted => true,stream_state => established,mgmt_resend => false,tls_verify => false,mgmt_ack_timeout => 60000,stream_authenticated => true,xmlns => <<"jabber:client">>,shaper => c2s_shaper,mgmt_stanzas_out => 0,auth_module => ejabberd_auth_sql,privacy_list => {userlist,none,[],false},mgmt_stanzas_req => 0,stream_direction => in,socket_monitor => #Ref<0.0.1.11300>,stream_header_sent => true,stream_timeout => infinity,pres_timestamp => {1499,342589,182000},zlib => false,server => <<"casino.com">>,tls_enabled => true,jid => {jid,<<"praveen">> ,<<"casino.com">>,<<"-">>,<<"praveen">>,<<"casino.com">>,<<"-">>},ip => {{127,0,0,1},55611},access => c2s,caps_resources => {1,{{<<"praveen">>,<<"casino.com">>,<<"-">>},{caps,<<"http://pidgin.im/">>,<<"I22W7CegORwdbnu0ZiQwGpxr0Go=">>,<<"sha-1">>,[]},nil,nil}},tls_options => [compression_none,{protocol_options,<<"no_sslv3">>},{certfile,<<"C:\\ProgramData\\ejabberd\\conf\\server.pem">>}],pres_t => {1,{{<<"praveen">>,<<"casino.com">>,<<>>},nil,nil}},conn => c2s_tls,sockmod => ejabberd_socket,stream_id => <<"11446533041510383550">>,pres_f => {1,{{<<"praveen">>,<<"casino.com">>,<<>>},nil,nil}},user => <<"praveen">>,stream_restarted => true,mgmt_max_queue => 1000,mod => ejabberd_c2s,pres_a => {2,{{<<"praveen">>,<<"casino.com">>,<<>>},nil,{{<<"room">>,<<"conference.casino.com">>,<<"praveen">>},nil,nil}}},csi_state => active,owner => <0.506.0>,socket => {socket_state,fast_tls,{tlssock,#Port<0.23159>,#Port<0.23222>},<0.505.0>},mgmt_timeout => 300,sid => {{1499,342588,1},<0.506.0>},st ream_version => {1,0},mgmt_state => inactive,tls_required => false,lang => <<"en">>,pres_last => {presence,<<>>,available,<<"en">>,{jid,<<"praveen">>,<<"casino.com">>,<<"-">>,<<"praveen">>,<<"casino.com">>,<<"-">>},{jid,<<"praveen">>,<<"casino.com">>,<<>>,<<"praveen">>,<<"casino.com">>,<<>>},undefined,[{text,<<>>,<<"I like cricket">>}],1,[{xmlel,<<"c">>,[{<<"xmlns">>,<<"http://jabber.org/protocol/caps">>},{<<"node">>,<<"http://pidgin.im/">>},{<<"hash">>,<<"sha-1">>},{<<"ver">>,<<"I22W7CegORwdbnu0ZiQwGpxr0Go=">>}],[]},{xmlel,<<"x">>,[{<<"xmlns">>,<<"vcard-temp:x:update">>}],[{xmlel,<<"photo">>,[],[]}]}],#{ip => {127,0,0,1}}},mgmt_stanzas_in => 0}}] > > > Can anybody guide me how to run the game on the MUC room also? > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrtndimitrov@REDACTED Thu Jul 6 16:00:00 2017 From: mrtndimitrov@REDACTED (Martin Dimitrov) Date: Thu, 6 Jul 2017 17:00:00 +0300 Subject: [erlang-questions] net_adm:ping/1 fails with Erlang/OTP 20 Message-ID: <595e4260.16a5df0a.fdff0.1f4d@mx.google.com> Hello, I am using jInterface 1.5.3.1 for an Erlang-Java communication. It all used to work fine prior to upgrading to Erlang/OTP 20. Now net_adm:ping/1 fails with the following message: [error] ** 'dilbert@REDACTED': Connection attempt to node 'jnode@REDACTED' aborted since it cannot handle ["UTF8_ATOMS"].** Any ideas what can it be? Thanks, Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Thu Jul 6 16:02:56 2017 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Thu, 6 Jul 2017 17:02:56 +0300 Subject: [erlang-questions] net_adm:ping/1 fails with Erlang/OTP 20 In-Reply-To: <595e4260.16a5df0a.fdff0.1f4d@mx.google.com> References: <595e4260.16a5df0a.fdff0.1f4d@mx.google.com> Message-ID: As far, I re-call OTP 20 made changes to external term format. It looks like you need to build and use jinterface from OTP 20. The maven version might not be up to date. - Dmitry > On Jul 6, 2017, at 5:00 PM, Martin Dimitrov wrote: > > > Hello, > > I am using jInterface 1.5.3.1 for an Erlang-Java communication. It all used to work fine prior to upgrading to Erlang/OTP 20. Now net_adm:ping/1 fails with the following message: > > [error] ** 'dilbert@REDACTED': Connection attempt to node 'jnode@REDACTED' aborted since it cannot handle ["UTF8_ATOMS"].** > > Any ideas what can it be? > > Thanks, > Martin > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From eric.des.courtis@REDACTED Thu Jul 6 16:03:12 2017 From: eric.des.courtis@REDACTED (Eric des Courtis) Date: Thu, 6 Jul 2017 10:03:12 -0400 Subject: [erlang-questions] net_adm:ping/1 fails with Erlang/OTP 20 In-Reply-To: <595e4260.16a5df0a.fdff0.1f4d@mx.google.com> References: <595e4260.16a5df0a.fdff0.1f4d@mx.google.com> Message-ID: I suspect it's because it cannot handle UTF-8 atoms (vs Latin-1 atoms). Are you using the jinterface that is shipped with Erlang/OTP 20? On Thu, Jul 6, 2017 at 10:00 AM, Martin Dimitrov wrote: > > > Hello, > > > > I am using jInterface 1.5.3.1 for an Erlang-Java communication. It all > used to work fine prior to upgrading to Erlang/OTP 20. Now net_adm:ping/1 > fails with the following message: > > > > [error] ** 'dilbert@REDACTED': Connection attempt to node 'jnode@REDACTED' > aborted since it cannot handle ["UTF8_ATOMS"].** > > > > Any ideas what can it be? > > > > Thanks, > > Martin > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrtndimitrov@REDACTED Thu Jul 6 16:05:15 2017 From: mrtndimitrov@REDACTED (Martin Dimitrov) Date: Thu, 6 Jul 2017 17:05:15 +0300 Subject: [erlang-questions] net_adm:ping/1 fails with Erlang/OTP 20 In-Reply-To: References: <595e4260.16a5df0a.fdff0.1f4d@mx.google.com> Message-ID: <595e439b.810f1c0a.9a24f.4a5b@mx.google.com> No, I am using the latest maven version. I will try what you?ve suggested and will let you know. Thanks, guys. From: Eric des Courtis Sent: Thursday, July 6, 2017 5:03 PM To: Martin Dimitrov Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] net_adm:ping/1 fails with Erlang/OTP 20 I suspect it's because it cannot handle UTF-8 atoms (vs Latin-1 atoms). Are you using the jinterface that is shipped with Erlang/OTP 20? On Thu, Jul 6, 2017 at 10:00 AM, Martin Dimitrov wrote: ? Hello, ? I am using jInterface 1.5.3.1 for an Erlang-Java communication. It all used to work fine prior to upgrading to Erlang/OTP 20. Now net_adm:ping/1 fails with the following message: ? [error] ** 'dilbert@REDACTED': Connection attempt to node 'jnode@REDACTED' aborted since it cannot handle ["UTF8_ATOMS"].** ? Any ideas what can it be? ? Thanks, Martin _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex0player@REDACTED Thu Jul 6 16:51:06 2017 From: alex0player@REDACTED (Alex S.) Date: Thu, 6 Jul 2017 17:51:06 +0300 Subject: [erlang-questions] wxErlang - some answers In-Reply-To: References: Message-ID: The prog21.dadgum.com guy, James Hague, puts forth that he writes a GUI controller in another language and uses that as a port to communicate with. May that be a fruitful approach? 6 ???? 2017 ?. 10:56 AM ???????????? "Frank Muller" < frank.muller.erl@REDACTED> ???????: > Joe, > > What about the idea behind "GTK server": > http://www.gtk-server.org/ > > Best > /Frank > > Le mar. 4 juil. 2017 ? 18:18, Joe Armstrong a ?crit : > >> I'm trying to get to grips with wxErlang so I toddled over to Ericsson >> and sat down for a few hours with Dan Gudmundsson and asked him a boat >> load of stupid questions. >> >> I'll be writing a lot more about this and setting up a github project >> to document how to get tame wxErlang ... >> >> Here's a first attempt at figuring out how things work. >> >> My usual approach to understanding things is always the same. >> >> "Take a program that works. Then remove non-essential bits until >> all that is left is so simple that you can understand it." >> >> How about making some buttons - this should be easy >> >> I started with demo.erl in ${ERL_TOP}/lib/wx/examples/demo/demo.erl >> >> This has some code for making buttons - but it also does *a lot more* >> and *it is highly redundant* -- from the point of view of learning the >> code volume does not assist comprehension, nor does using a generic >> behavior. >> >> What do I mean by this? >> >> - ex_button.erl is written using wx_object.erl >> so to understand ex_button.erl I have to also understand >> wx_object.erl >> - ex_button.erl has repeated code. For example >> several buttons have tooltips, but I only need to be shown how to do >> this >> *once* not several times >> - ex_button.erl introduces several new concepts - in particular spacers >> and sizers - and I haven't a clue what they do. >> >> Now I'm going to refactor ex_button.erl so take a deep breath ... >> >> First refactoring: remove the dependency on wx_object >> >> I'd already figured out that a *minimal* wx windows program is: >> >> start() -> >> Wx = wx_win:new(), >> Frame = wxFrame:new(Wx, -1, "Window Title"), >> wxFrame:show(Frame). >> >> To make the window do something I'd want to write: >> >> start() -> >> Wx = wx_win:new(), >> Frame = wxFrame:new(Wx, -1, "Window Title"), >> setup_window(Frame), >> wxFrame:show(Frame), >> loop(). >> >> loop() -> >> receive >> Any -> >> io:format("Any=~p~n",[Any]) >> end, >> loop(). >> >> Given this structure I refactored ex_button.erl into buttons_demo.erl >> which removes all the wx_object code. So now I can stare are the code >> in buttons_demo.erl and see if I can understand it, for my point of >> view it's far easier to understand than ex_buttons.erl since there is >> no dependency on wx_object.erl >> >> Second refactoring: Simplify buttons_demo.erl >> >> The original program has four rows of buttons - but one will >> be sufficient for me. >> >> I now removed many lines of code, until only one line of buttons >> remained. >> >> The resulting code buttons_demo1.erl now only creates one line of buttons >> and has a couple of sizers. >> >> Dan told me that the line of code: >> >> wxStaticBoxSizer:new(?wxHORIZONTAL, Panel,[{label, "wxButton"}]), >> >> Is wxWidgets way of making an hbox - Goodness wxWidgets can be build >> using Knuthian hboxes and vboxes (horray). >> >> I'm still not happy with buttons_demo1.erl since it mixes two ideas: >> >> - making buttons >> - putting buttons in a container and laying out the containers >> >> This needs to be refactored into: >> >> - a pure button examples >> - a pure layout example >> >> My intention is to try and decompose wxErlang into a large number of >> small examples, where each example illustrates one feature of the >> system. Also so show how to build complex examples from the small >> parts. >> >> I'll make all the code available on github so you can join in the fun >> (is this fun?). >> >> Notes: >> >> [1] Feel free to send me examples of wxErlang code - preferably >> one example per module that illustrates one feature. >> >> [2] Anybody want to do this for elixir? >> >> [3] The WxWidgets documentation is a terminological mess - they call >> *everything* (including a button) a window. >> >> [4] The WxWidget examples (in C++) require subclassing several objects >> resulting in multiple files per example - the Erlang equivalent is >> nicely contained within a single module (which is far nicer) >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eshikafe@REDACTED Thu Jul 6 20:03:10 2017 From: eshikafe@REDACTED (austin aigbe) Date: Thu, 6 Jul 2017 19:03:10 +0100 Subject: [erlang-questions] Precompiled Erlang OTP Binary for Solaris x86 Message-ID: Hello, Please any precompiled Erlang OTP binary for Solaris 10 x86. Especially Erlang OTP 19 to OTP 20. OpenCSW has version R16B which is always crashing. I tested this on my Solaris 10 x86 vagrant box austin@REDACTED:~/solaris-10-x86-box$ vagrant ssh Last login: Thu Jul 6 15:47:38 2017 from 10.0.2.2 Oracle Corporation SunOS 5.10 Generic Patch January 2005 -bash-3.2$ su Password: # pkgutil -i erlang Solving needed dependencies ... Solving dependency order ... 4 CURRENT packages: CSWcommon-1.5,REV=2010.12.11 CSWlibncurses5-5.9,REV=2011.11.21 CSWlibssl1-0-0-1.0.1u,REV=2016.10.04 CSWterminfo-6.0,REV=2016.04.01 Install 1 NEW packages: CSWerlang-R16B,REV=2013.06.06 (OpenCSW/stable) Total size: 72.1 MB => Fetching CSWerlang-R16B,REV=2013.06.06 (1/1) ... ... CSWerlang erlang - A functional programming language from Ericsson (i386) R16B,REV=2013.06.06 ... /opt/csw/share/doc/erlang/license [ verifying class ] Installation of was successful. # # erl {error_logger,{{2017,7,6},{17,40,32}},"~s~n",["beam/beam_load.c(1051): Error loading module hipe_unified_loader:\n form size 29016 greater than size 28759 of binary\n"]} {error_logger,{{2017,7,6},{17,40,32}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,{'EXIT',{undef,[{hipe_unified_loader,module_info,[module],[]},{code,'-load_code_server_prerequisites/0-lc$^0/1-0-',1,[{file,"code.erl"},{line,367}]},{code,load_code_server_prerequisites,0,[{file,"code.erl"},{line,367}]},{code,do_start,1,[{file,"code.erl"},{line,324}]},{supervisor,do_start_child,2,[{file,"supervisor.erl"},{line,308}]},{supervisor,start_children,3,[{file,"supervisor.erl"},{line,291}]},{supervisor,init_children,2,[{file,"supervisor.erl"},{line,257}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]}]}}},{offender,[{pid,undefined},{name,code_server},{mfargs,{code,start_link,[]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]} {error_logger,{{2017,7,6},{17,40,32}},crash_report,[[{initial_call,{application_master,init,['Argument__1','Argument__2','Argument__3','Argument__4']}},{pid,<0.9.0>},{registered_name,[]},{error_info,{exit,{{shutdown,{failed_to_start_child,code_server,{'EXIT',{undef,[{hipe_unified_loader,module_info,[module],[]},{code,'-load_code_server_prerequisites/0-lc$^0/1-0-',1,[{file,"code.erl"},{line,367}]},{code,load_code_server_prerequisites,0,[{file,"code.erl"},{line,367}]},{code,do_start,1,[{file,"code.erl"},{line,324}]},{supervisor,do_start_child,2,[{file,"supervisor.erl"},{line,308}]},{supervisor,start_children,3,[{file,"supervisor.erl"},{line,291}]},{supervisor,init_children,2,[{file,"supervisor.erl"},{line,257}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]}]}}}},{kernel,start,[normal,[]]}},[{application_master,init,4,[{file,"application_master.erl"},{line,138}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}},{ancestors,[<0.8.0>]},{messages,[{'EXIT',<0.10.0>,normal}]},{links,[<0.8.0>,<0.7.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,987},{stack_size,27},{reductions,201}],[]]} {error_logger,{{2017,7,6},{17,40,32}},std_info,[{application,kernel},{exited,{{shutdown,{failed_to_start_child,code_server,{'EXIT',{undef,[{hipe_unified_loader,module_info,[module],[]},{code,'-load_code_server_prerequisites/0-lc$^0/1-0-',1,[{file,"code.erl"},{line,367}]},{code,load_code_server_prerequisites,0,[{file,"code.erl"},{line,367}]},{code,do_start,1,[{file,"code.erl"},{line,324}]},{supervisor,do_start_child,2,[{file,"supervisor.erl"},{line,308}]},{supervisor,start_children,3,[{file,"supervisor.erl"},{line,291}]},{supervisor,init_children,2,[{file,"supervisor.erl"},{line,257}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]}]}}}},{kernel,start,[normal,[]]}}},{type,permanent}]} {"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,code_server,{'EXIT',{undef,[{hipe_unified_loader,module_info,[module],[]},{code,'-load_code_server_prerequisites/0-lc$^0/1-0-',1,[{file,\"code.erl\"},{line,367}]},{code,load_code_server_prerequisites,0,[{file,\"code.erl\"},{line,367}]},{code,do_start,1,[{file,\"code.erl\"},{line,324}]},{supervisor,do_start_child,2,[{file,\"supervisor.erl\"},{line,308}]},{supervisor,start_children,3,[{file,\"supervisor.erl\"},{line,291}]},{supervisor,init_children,2,[{file,\"supervisor.erl\"},{line,257}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,304}]}]}}}},{kernel,start,[normal,[]]}}}"} Crash dump was written to: erl_crash.dump Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,code_server,{'EXIT',{undef,[{hipe_unified_loader,module_info,[module],[]},{code,'- # Thanks. BR, Austin -------------- next part -------------- An HTML attachment was scrubbed... URL: From gordeev.vladimir.v@REDACTED Fri Jul 7 05:01:49 2017 From: gordeev.vladimir.v@REDACTED (Vladimir Gordeev) Date: Fri, 7 Jul 2017 06:01:49 +0300 Subject: [erlang-questions] Erlang Shell Visualization demo Message-ID: Hey! Recently I was experimenting with Erlang tracer and visualization, made a process visualization demo for erlang shell session: http://vladimir-vg.me/erlang-shell-visualization-demo/ Also recorded a video explaining it: https://www.youtube.com/watch?v=6eqlLps6Flg Thought that it might be interesting for subscribers. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrtndimitrov@REDACTED Fri Jul 7 09:28:37 2017 From: mrtndimitrov@REDACTED (Martin Dimitrov) Date: Fri, 7 Jul 2017 10:28:37 +0300 Subject: [erlang-questions] net_adm:ping/1 fails with Erlang/OTP 20 In-Reply-To: <595e439b.810f1c0a.9a24f.4a5b@mx.google.com> References: <595e4260.16a5df0a.fdff0.1f4d@mx.google.com> <595e439b.810f1c0a.9a24f.4a5b@mx.google.com> Message-ID: <595f3826.71a0df0a.7440c.ddf8@mx.google.com> Hello again, With 1.8 version I don?t see this problem. Thanks. Regards, Martin From: Martin Dimitrov Sent: Thursday, July 6, 2017 5:05 PM To: Eric des Courtis Cc: erlang-questions@REDACTED Subject: RE: [erlang-questions] net_adm:ping/1 fails with Erlang/OTP 20 No, I am using the latest maven version. I will try what you?ve suggested and will let you know. Thanks, guys. From: Eric des Courtis Sent: Thursday, July 6, 2017 5:03 PM To: Martin Dimitrov Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] net_adm:ping/1 fails with Erlang/OTP 20 I suspect it's because it cannot handle UTF-8 atoms (vs Latin-1 atoms). Are you using the jinterface that is shipped with Erlang/OTP 20? On Thu, Jul 6, 2017 at 10:00 AM, Martin Dimitrov wrote: ? Hello, ? I am using jInterface 1.5.3.1 for an Erlang-Java communication. It all used to work fine prior to upgrading to Erlang/OTP 20. Now net_adm:ping/1 fails with the following message: ? [error] ** 'dilbert@REDACTED': Connection attempt to node 'jnode@REDACTED' aborted since it cannot handle ["UTF8_ATOMS"].** ? Any ideas what can it be? ? Thanks, Martin _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From eshikafe@REDACTED Fri Jul 7 13:42:28 2017 From: eshikafe@REDACTED (austin aigbe) Date: Fri, 7 Jul 2017 12:42:28 +0100 Subject: [erlang-questions] Pre-compiled Erlang/OTP 20 Binary for Solaris x86 Message-ID: Hello, Please any precompiled Erlang OTP binary for Solaris 10 x86. Especially Erlang OTP 19 to OTP 20. OpenCSW has version R16B which is always crashing. I tested this on my Solaris 10 x86 vagrant box austin@REDACTED:~/solaris-10-x86-box$ vagrant ssh Last login: Thu Jul 6 15:47:38 2017 from 10.0.2.2 Oracle Corporation SunOS 5.10 Generic Patch January 2005 -bash-3.2$ su Password: # pkgutil -i erlang Solving needed dependencies ... Solving dependency order ... 4 CURRENT packages: CSWcommon-1.5,REV=2010.12.11 CSWlibncurses5-5.9,REV=2011.11.21 CSWlibssl1-0-0-1.0.1u,REV=2016.10.04 CSWterminfo-6.0,REV=2016.04.01 Install 1 NEW packages: CSWerlang-R16B,REV=2013.06.06 (OpenCSW/stable) Total size: 72.1 MB => Fetching CSWerlang-R16B,REV=2013.06.06 (1/1) ... ... CSWerlang erlang - A functional programming language from Ericsson (i386) R16B,REV=2013.06.06 ... /opt/csw/share/doc/erlang/license [ verifying class ] Installation of was successful. # # erl {error_logger,{{2017,7,6},{17,40,32}},"~s~n",["beam/beam_load.c(1051): Error loading module hipe_unified_loader:\n form size 29016 greater than size 28759 of binary\n"]} {error_logger,{{2017,7,6},{17,40,32}},supervisor_report,[{ supervisor,{local,kernel_sup}},{errorContext,start_error},{ reason,{'EXIT',{undef,[{hipe_unified_loader,module_info,[ module],[]},{code,'-load_code_server_prerequisites/0-lc$^0/ 1-0-',1,[{file,"code.erl"},{line,367}]},{code,load_code_ server_prerequisites,0,[{file,"code.erl"},{line,367}]},{ code,do_start,1,[{file,"code.erl"},{line,324}]},{ supervisor,do_start_child,2,[{file,"supervisor.erl"},{line, 308}]},{supervisor,start_children,3,[{file,"supervisor.erl"},{line,291}]},{ supervisor,init_children,2,[{file,"supervisor.erl"},{line, 257}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line, 304}]}]}}},{offender,[{pid,undefined},{name,code_server}, {mfargs,{code,start_link,[]}},{restart_type,permanent},{ shutdown,2000},{child_type,worker}]}]} {error_logger,{{2017,7,6},{17,40,32}},crash_report,[[{ initial_call,{application_master,init,['Argument__1',' Argument__2','Argument__3','Argument__4']}},{pid,<0.9.0>}, {registered_name,[]},{error_info,{exit,{{shutdown,{failed_ to_start_child,code_server,{'EXIT',{undef,[{hipe_unified_ loader,module_info,[module],[]},{code,'-load_code_server_ prerequisites/0-lc$^0/1-0-',1,[{file,"code.erl"},{line,367}] },{code,load_code_server_prerequisites,0,[{file,"code. erl"},{line,367}]},{code,do_start,1,[{file,"code.erl"},{ line,324}]},{supervisor,do_start_child,2,[{file," supervisor.erl"},{line,308}]},{supervisor,start_children,3,[ {file,"supervisor.erl"},{line,291}]},{supervisor,init_ children,2,[{file,"supervisor.erl"},{line,257}]},{gen_ server,init_it,6,[{file,"gen_server.erl"},{line,304}]}]}}}} ,{kernel,start,[normal,[]]}},[{application_master,init,4,[{ file,"application_master.erl"},{line,138}]},{proc_lib,init_ p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}},{ancestors,[<0.8.0>]},{ messages,[{'EXIT',<0.10.0>,normal}]},{links,[<0.8.0>,<0. 7.0>]},{dictionary,[]},{trap_exit,true},{status,running},{ heap_size,987},{stack_size,27},{reductions,201}],[]]} {error_logger,{{2017,7,6},{17,40,32}},std_info,[{ application,kernel},{exited,{{shutdown,{failed_to_start_ child,code_server,{'EXIT',{undef,[{hipe_unified_loader, module_info,[module],[]},{code,'-load_code_server_ prerequisites/0-lc$^0/1-0-',1,[{file,"code.erl"},{line,367}] },{code,load_code_server_prerequisites,0,[{file,"code. erl"},{line,367}]},{code,do_start,1,[{file,"code.erl"},{ line,324}]},{supervisor,do_start_child,2,[{file," supervisor.erl"},{line,308}]},{supervisor,start_children,3,[ {file,"supervisor.erl"},{line,291}]},{supervisor,init_ children,2,[{file,"supervisor.erl"},{line,257}]},{gen_ server,init_it,6,[{file,"gen_server.erl"},{line,304}]}]}}}} ,{kernel,start,[normal,[]]}}},{type,permanent}]} {"Kernel pid terminated",application_controller,"{application_ start_failure,kernel,{{shutdown,{failed_to_start_child,code_server,{'EXIT',{ undef,[{hipe_unified_loader,module_info,[module],[]},{ code,'-load_code_server_prerequisites/0-lc$^0/1-0-',1, [{file,\"code.erl\"},{line,367}]},{code,load_code_server_ prerequisites,0,[{file,\"code.erl\"},{line,367}]},{code,do_ start,1,[{file,\"code.erl\"},{line,324}]},{supervisor,do_ start_child,2,[{file,\"supervisor.erl\"},{line,308}]} ,{supervisor,start_children,3,[{file,\"supervisor.erl\"},{ line,291}]},{supervisor,init_children,2,[{file,\" supervisor.erl\"},{line,257}]},{gen_server,init_it,6,[{file, \"gen_server.erl\"},{line,304}]}]}}}},{kernel,start,[normal,[]]}}}"} Crash dump was written to: erl_crash.dump Kernel pid terminated (application_controller) ({application_start_failure, kernel,{{shutdown,{failed_to_start_child,code_server,{' EXIT',{undef,[{hipe_unified_loader,module_info,[module],[]},{code,'- # Thanks. BR, Austin -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmytro.lytovchenko@REDACTED Fri Jul 7 13:45:12 2017 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Fri, 7 Jul 2017 13:45:12 +0200 Subject: [erlang-questions] Pre-compiled Erlang/OTP 20 Binary for Solaris x86 In-Reply-To: References: Message-ID: Please use kerl https://github.com/kerl/kerl it will download the version you want and build it for you Note that when building under Solaris HiPE feature should be disabled with the "--disable-hipe" option (as per this guide https://gist.github.com/drewkerrigan/7795322 ) 2017-07-07 13:42 GMT+02:00 austin aigbe : > Hello, > > Please any precompiled Erlang OTP binary for Solaris 10 x86. > > Especially Erlang OTP 19 to OTP 20. > > OpenCSW has version R16B which is always crashing. I tested this on my > Solaris 10 x86 vagrant box > > austin@REDACTED:~/solaris-10-x86-box$ vagrant ssh > Last login: Thu Jul 6 15:47:38 2017 from 10.0.2.2 > Oracle Corporation SunOS 5.10 Generic Patch January 2005 > -bash-3.2$ su > Password: > # pkgutil -i erlang > Solving needed dependencies ... > Solving dependency order ... > 4 CURRENT packages: > CSWcommon-1.5,REV=2010.12.11 > CSWlibncurses5-5.9,REV=2011.11.21 > CSWlibssl1-0-0-1.0.1u,REV=2016.10.04 > CSWterminfo-6.0,REV=2016.04.01 > Install 1 NEW packages: > CSWerlang-R16B,REV=2013.06.06 (OpenCSW/stable) > Total size: 72.1 MB > => Fetching CSWerlang-R16B,REV=2013.06.06 (1/1) ... > > ... > CSWerlang erlang - A functional programming language from Ericsson > (i386) R16B,REV=2013.06.06 > ... > > /opt/csw/share/doc/erlang/license > [ verifying class ] > > Installation of was successful. > # > > > # erl > {error_logger,{{2017,7,6},{17,40,32}},"~s~n",["beam/beam_load.c(1051): > Error loading module hipe_unified_loader:\n form size 29016 greater than > size 28759 of binary\n"]} > {error_logger,{{2017,7,6},{17,40,32}},supervisor_report,[{su > pervisor,{local,kernel_sup}},{errorContext,start_error},{rea > son,{'EXIT',{undef,[{hipe_unified_loader,module_info,[module > ],[]},{code,'-load_code_server_prerequisites/0-lc$^0/1-0-', > 1,[{file,"code.erl"},{line,367}]},{code,load_code_server_ > prerequisites,0,[{file,"code.erl"},{line,367}]},{code,do_ > start,1,[{file,"code.erl"},{line,324}]},{supervisor,do_ > start_child,2,[{file,"supervisor.erl"},{line,308}]}, > {supervisor,start_children,3,[{file,"supervisor.erl"},{line, > 291}]},{supervisor,init_children,2,[{file,"supervisor. > erl"},{line,257}]},{gen_server,init_it,6,[{file,"gen_ > server.erl"},{line,304}]}]}}},{offender,[{pid,undefined},{ > name,code_server},{mfargs,{code,start_link,[]}},{restart_ > type,permanent},{shutdown,2000},{child_type,worker}]}]} > {error_logger,{{2017,7,6},{17,40,32}},crash_report,[[{initia > l_call,{application_master,init,['Argument__1','Argument_ > _2','Argument__3','Argument__4']}},{pid,<0.9.0>},{ > registered_name,[]},{error_info,{exit,{{shutdown,{failed_to_ > start_child,code_server,{'EXIT',{undef,[{hipe_unified_loader > ,module_info,[module],[]},{code,'-load_code_server_prereq > uisites/0-lc$^0/1-0-',1,[{file,"code.erl"},{line,367}]}, > {code,load_code_server_prerequisites,0,[{file,"code.erl"},{ > line,367}]},{code,do_start,1,[{file,"code.erl"},{line,324}]} > ,{supervisor,do_start_child,2,[{file,"supervisor.erl"},{ > line,308}]},{supervisor,start_children,3,[{file,"supervisor. > erl"},{line,291}]},{supervisor,init_children,2,[{ > file,"supervisor.erl"},{line,257}]},{gen_server,init_it,6,[ > {file,"gen_server.erl"},{line,304}]}]}}}},{kernel,start,[ > normal,[]]}},[{application_master,init,4,[{file," > application_master.erl"},{line,138}]},{proc_lib,init_p_do_apply,3,[{file," > proc_lib.erl"},{line,239}]}]}},{ancestors,[<0.8.0>]},{messages,[{'EXIT' > ,<0.10.0>,normal}]},{links,[<0.8.0>,<0.7.0>]},{dictionary,[ > ]},{trap_exit,true},{status,running},{heap_size,987},{ > stack_size,27},{reductions,201}],[]]} > {error_logger,{{2017,7,6},{17,40,32}},std_info,[{application > ,kernel},{exited,{{shutdown,{failed_to_start_child,code_ > server,{'EXIT',{undef,[{hipe_unified_loader,module_info,[ > module],[]},{code,'-load_code_server_prerequisites/0-lc$^0/ > 1-0-',1,[{file,"code.erl"},{line,367}]},{code,load_code_ > server_prerequisites,0,[{file,"code.erl"},{line,367}]},{ > code,do_start,1,[{file,"code.erl"},{line,324}]},{ > supervisor,do_start_child,2,[{file,"supervisor.erl"},{line, > 308}]},{supervisor,start_children,3,[{file,"supervisor. > erl"},{line,291}]},{supervisor,init_children,2,[{ > file,"supervisor.erl"},{line,257}]},{gen_server,init_it,6,[ > {file,"gen_server.erl"},{line,304}]}]}}}},{kernel,start,[ > normal,[]]}}},{type,permanent}]} > {"Kernel pid terminated",application_controller,"{application_start_ > failure,kernel,{{shutdown,{failed_to_start_child,code_ > server,{'EXIT',{undef,[{hipe_unified_loader,module_info,[ > module],[]},{code,'-load_code_server_prerequisites/0-lc$^0/ > 1-0-',1,[{file,\"code.erl\"},{line,367}]},{code,load_code_ > server_prerequisites,0,[{file,\"code.erl\"},{line,367}]},{ > code,do_start,1,[{file,\"code.erl\"},{line,324}]},{ > supervisor,do_start_child,2,[{file,\"supervisor.erl\"},{ > line,308}]},{supervisor,start_children,3,[{file,\" > supervisor.erl\"},{line,291}]},{supervisor,init_children,2,[ > {file,\"supervisor.erl\"},{line,257}]},{gen_server,init_ > it,6,[{file,\"gen_server.erl\"},{line,304}]}]}}}},{kernel, > start,[normal,[]]}}}"} > > Crash dump was written to: erl_crash.dump > Kernel pid terminated (application_controller) > ({application_start_failure,kernel,{{shutdown,{failed_to_sta > rt_child,code_server,{'EXIT',{undef,[{hipe_unified_loader, > module_info,[module],[]},{code,'- > # > > Thanks. > > BR, > Austin > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bp@REDACTED Fri Jul 7 14:15:19 2017 From: bp@REDACTED (Bjarne Wichmann Bagge Petersen) Date: Fri, 7 Jul 2017 14:15:19 +0200 Subject: [erlang-questions] IntelliJ, erlang-plugin and disappearing edits Message-ID: Hi I have a really annoying problem - I make edits to files and they disappear. It doesn't happen often - but it does happen. Usually I just log it under "I probably just thought I'd make the edit but never really did - I'm getting old". Today, though, I was certain and looked into the history of the file I edited (IntelliJ have a local history). It *did* show that I made the edits... and then 4 minutes later the file have been reverted to its previous state (no indication of edits). I suspect `_build` and how IntelliJ handles it. Ie. contents from _build is being written back to the sources. I can mark `_build` as `excluded`, but that kills autocomplete. I don't want that. I really don't know where the problem lies (me, IntelliJ or erlang-plugin) - any tips from IntelliJ users would be welcome. Best regards Bjarne Wichmann Bagge Petersen Backend Developer, ShopGun E: bp@REDACTED L: dk.linkedin.com/in/bjarnewp W: shopgun.com A: Arne Jacobsens All? 16, Field's, 3rd floor, DK-2300 K?benhavn S, Denmark -- ShopGun is people's shopping planner app that lets them pull the trigger on local deals, saving people money & making their everyday lives easier. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmytro.lytovchenko@REDACTED Fri Jul 7 14:20:00 2017 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Fri, 7 Jul 2017 14:20:00 +0200 Subject: [erlang-questions] IntelliJ, erlang-plugin and disappearing edits In-Reply-To: References: Message-ID: '_build' creates links to your source directories, which makes duplicate search results and some of your files when you jump to files and locations, may open from that duplicate directory. Then you open it manually from its original location and voila, now you have two conflicting tabs with same open file. Don't mark whole '_build' as excluded, instead mark clones of your OWN applications inside _build/lib/*/ as excluded. Keep the dependency libraries included for autocomplete to work. 2017-07-07 14:15 GMT+02:00 Bjarne Wichmann Bagge Petersen : > Hi > > I have a really annoying problem - I make edits to files and they > disappear. > > It doesn't happen often - but it does happen. Usually I just log it under > "I probably just thought I'd make the edit but never really did - I'm > getting old". > > Today, though, I was certain and looked into the history of the file I > edited (IntelliJ have a local history). It *did* show that I made the > edits... and then 4 minutes later the file have been reverted to its > previous state (no indication of edits). > > I suspect `_build` and how IntelliJ handles it. Ie. contents from _build > is being written back to the sources. > > I can mark `_build` as `excluded`, but that kills autocomplete. I don't > want that. > > I really don't know where the problem lies (me, IntelliJ or erlang-plugin) > - any tips from IntelliJ users would be welcome. > > > Best regards > > > Bjarne Wichmann Bagge Petersen > > Backend Developer, ShopGun > > > E: bp@REDACTED > L: dk.linkedin.com/in/bjarnewp > W: shopgun.com > A: Arne Jacobsens All? 16, Field's, 3rd floor, DK-2300 K?benhavn S, Denmark > > ShopGun is people's shopping planner app > that lets them pull the trigger on > local deals, saving people money & making their everyday lives easier. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bp@REDACTED Fri Jul 7 14:43:52 2017 From: bp@REDACTED (Bjarne Wichmann Bagge Petersen) Date: Fri, 7 Jul 2017 14:43:52 +0200 Subject: [erlang-questions] IntelliJ, erlang-plugin and disappearing edits In-Reply-To: References: Message-ID: Thx I've been burned hard by that exact scenario - but this time I am pretty certain that wasn't it (I don't have the `_build` version open in tab). But I will try the selective exclude and see how it goes. Thx. Best regards Bjarne Wichmann Bagge Petersen Backend Developer, ShopGun E: bp@REDACTED L: dk.linkedin.com/in/bjarnewp W: shopgun.com A: Arne Jacobsens All? 16, Field's, 3rd floor, DK-2300 K?benhavn S, Denmark 2017-07-07 14:20 GMT+02:00 Dmytro Lytovchenko : > '_build' creates links to your source directories, which makes duplicate > search results and some of your files when you jump to files and locations, > may open from that duplicate directory. Then you open it manually from its > original location and voila, now you have two conflicting tabs with same > open file. > > Don't mark whole '_build' as excluded, instead mark clones of your OWN > applications inside _build/lib/*/ as excluded. Keep the dependency > libraries included for autocomplete to work. > > 2017-07-07 14:15 GMT+02:00 Bjarne Wichmann Bagge Petersen > : > >> Hi >> >> I have a really annoying problem - I make edits to files and they >> disappear. >> >> It doesn't happen often - but it does happen. Usually I just log it under >> "I probably just thought I'd make the edit but never really did - I'm >> getting old". >> >> Today, though, I was certain and looked into the history of the file I >> edited (IntelliJ have a local history). It *did* show that I made the >> edits... and then 4 minutes later the file have been reverted to its >> previous state (no indication of edits). >> >> I suspect `_build` and how IntelliJ handles it. Ie. contents from _build >> is being written back to the sources. >> >> I can mark `_build` as `excluded`, but that kills autocomplete. I don't >> want that. >> >> I really don't know where the problem lies (me, IntelliJ or >> erlang-plugin) - any tips from IntelliJ users would be welcome. >> >> >> Best regards >> >> >> Bjarne Wichmann Bagge Petersen >> >> Backend Developer, ShopGun >> >> >> E: bp@REDACTED >> L: dk.linkedin.com/in/bjarnewp >> W: shopgun.com >> A: Arne Jacobsens All? 16, Field's, 3rd floor, DK-2300 K?benhavn S, >> Denmark >> >> ShopGun is people's shopping planner app >> that lets them pull the trigger on >> local deals, saving people money & making their everyday lives easier. >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- ShopGun is people's shopping planner app that lets them pull the trigger on local deals, saving people money & making their everyday lives easier. -------------- next part -------------- An HTML attachment was scrubbed... URL: From codewiget95@REDACTED Fri Jul 7 16:39:03 2017 From: codewiget95@REDACTED (asdf asdf) Date: Fri, 7 Jul 2017 10:39:03 -0400 Subject: [erlang-questions] Enabling TLS-PSK issue, Erlang is missing Ciphers? How would I add new ones? Message-ID: Hello everyone, I am currently working on adding PSK functionality to EMQTT and/or RabbitMQ, and my first goal is to get it working in standard Erlang. I have a client that will connect with public-keys, and I am attempting to modify it to suit my needs. A problem I have just encountered though is that Erlang does not seem to have any psk-ciphers , when I run rp(ssl:cipher_suites(erlang)). in the erlang terminal, I get a long list of ciphers but none of them are psk ciphers. For example, a cipher I am looking for is {psk, aes_256, sha512}, but none are psk: [{ecdhe_ecdsa,aes_256_gcm,null}, {ecdhe_rsa,aes_256_gcm,null}, {ecdhe_ecdsa,aes_256_cbc,sha384}, {ecdhe_rsa,aes_256_cbc,sha384}, \... ... etc When I run rp(ssl:cipher_suites(openssl)). in the terminal, similarly, there are no psk ciphers ------ However, the Erlang documentation for ssl (http://erlang.org/doc/man/ssl.html ) clearly states that psk is possible. And my openssl does contain psk ciphers for that matter. When I run openssl ciphers, two psk ciphers are available : PSK-AES256-CBC-SHA and PSK-RC4-SHA So, when I run my program, the server doesn't recognize the suite: HERE is the output when I try to connect: Eshell V7.2 (abort with ^G) 1> c(s). {ok,s} 2> s:start(). <0.52.0> 3> s:client("hello"). =ERROR REPORT==== 7-Jul-2017::10:20:34 === Error in process <0.52.0> with exit value: {{badmatch,{error,closed}},[{s,accept,1,[{file,"s.erl"},{line,13}]}]} ** exception exit: {badmatch,{error,{options,{ciphers,[{psk,aes_256_cbc, sha512}]}}}} in function s:client/1 (s.erl, line 36) Is there any way to add any ciphers to erlang? - I know/think that I also need to use a lookup_fun on my server in ssl:listen to go and match the psk_identity presented by the client to a profile , I received this link: https://github.com/erlang/otp/blob/32a1dca92c0f949ef6ce2c751b23aff82f9d998f/lib/ssl/test/ssl_test_lib.erl#L404 from another thread, pointing me to example implementation of the lookup_fun (sort of, not really). IF anyone can shed more light on this, I would greatly appreciate it. This is the next step once my server begins to recognize the cipher suite. HERE is my erlang code I am working on to enable psks: 1 -module(s). 2 -export([start/0, client/1, accept/1]). 3 4 start() -> 5 ssl:start(), 6 server(4000). 7 8 server(Port) -> 9 {ok, LSocket} = ssl:listen(Port, [{psk_identity, "abcde"}, {reuseaddr, true}]), 10 spawn(fun() -> accept(LSocket) end). 11 12 accept(LSocket) -> 13 {ok, Socket} = ssl:transport_accept(LSocket), 14 ok = ssl:ssl_accept(Socket), 15 Pid = spawn(fun() -> 16 io:format("Connection accepted ~p~n", [Socket]), 17 loop(Socket) 18 end), 19 ssl:controlling_process(Socket, Pid), 20 accept(LSocket). 21 22 loop(Socket) -> 23 ssl:setopts(Socket, [{active, once}]), 24 receive 25 {ssl,Sock, Data} -> 26 io:format("Got packet: ~p~n", [Data]), 27 ssl:send(Sock, Data), 28 loop(Socket); 29 {ssl_closed, Sock} -> 30 io:format("Closing socket: ~p~n", [Sock]); 31 Error -> 32 io:format("Error on socket: ~p~n", [Error]) 33 end. 34 35 client(N) -> 36 {ok, Socket} = ssl:connect("localhost", 4000, [{ciphers, [{psk, aes_256_cbc, sha512}]}, {psk_identity,"abcde"}]), 37 io:format("Client opened socket: ~p~n",[Socket]), 38 ok = ssl:send(Socket, N), 39 Value = receive 40 {ssl,{sslsocket,new_ssl,_}, Data} -> 41 io:format("Client received: ~p~n",[Data]) 42 after 2000 -> 43 0 44 end, 45 ssl:close(Socket), 46 Value. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aschultz@REDACTED Fri Jul 7 17:55:11 2017 From: aschultz@REDACTED (Andreas Schultz) Date: Fri, 7 Jul 2017 17:55:11 +0200 (CEST) Subject: [erlang-questions] Enabling TLS-PSK issue, Erlang is missing Ciphers? How would I add new ones? In-Reply-To: References: Message-ID: <963613300.606768.1499442911453.JavaMail.zimbra@tpip.net> Hi, ----- On Jul 7, 2017, at 4:39 PM, asdf asdf codewiget95@REDACTED wrote: > Hello everyone, > I am currently working on adding PSK functionality to EMQTT and/or RabbitMQ, and > my first goal is to get it working in standard Erlang. I have a client that > will connect with public-keys, and I am attempting to modify it to suit my > needs. You are aware that PSK (pre-shared keys) and client certificates are two different beasts? Your "public-keys" reference sounds a lot like client certificates! > A problem I have just encountered though is that Erlang does not seem to have > any psk-ciphers , when I run rp(ssl:cipher_suites(erlang)) . in the erlang > terminal, I get a long list of ciphers but none of them are psk ciphers. That's because ssl:cipher_suites(erlang) only lists the default suites, you need to use ssl:cipher_suites(all) to really see all suites. > For example, a cipher I am looking for is {psk, aes_256, sha512}, but none are > psk: There is no cipher suite that has "sha512" in its name. However, in TLS 1.2 the server and client are free to negotiate sha512 as hash for the verification of handshake. Some possible candidates are: * {dhe_psk, aes_256_gcm, null, sha384} * {dhe_psk, aes_256_cbc, sha384} * {rsa_psk, aes_256_gcm, null, sha384} * {rsa_psk, aes_256_cbc, sha384} I would strongly recommend the DHE ciphers! > - I know/think that I also need to use a lookup_fun on my server in ssl:listen to go and match the psk_identity presented by the client to a profile , > I received this link: [ https://github.com/erlang/otp/blob/32a1dca92c0f949ef6ce2c751b23aff82f9d998f/lib/ssl/test/ssl_test_lib.erl#L404 | from another thread, pointing me to example implementation of the lookup_fun (sort of, not really). IF anyone can shed more light on this, I would greatly appreciate it. This is the next step once my server begins to recognize the cipher suite. For PSK, you need a lookup function that gets the User Hint from the TLS Client Hello and returns the {ok, PSK} for that user. The PSK needs to be a binary. A very simple version with the same PSK for every user would be: user_lookup(psk, _Username, UserState) -> {ok, UserState}. And then you add this to your ssl options: {user_lookup_fun, {fun user_lookup/3, <<"secret">>}}, Regards Andreas PS: please do not send HTML formated mails. Other might be fine with them, but I won't respond to them. From erlang@REDACTED Sat Jul 8 10:50:35 2017 From: erlang@REDACTED (Joe Armstrong) Date: Sat, 8 Jul 2017 10:50:35 +0200 Subject: [erlang-questions] wxErlang question 3 Message-ID: More questions: seems like wxFrame:show(Frame) must come last This worked: a() -> Wx = wx:new(), Frame = wxFrame:new(Wx, -1, "Button"), ... add some stuff to the frame ... wxFrame:show(Frame), loop(Frame) This failed b()() -> Wx = wx:new(), Frame = wxFrame:new(Wx, -1, "Button"), wxFrame:show(Frame) ... add some stuff to the frame .. loop(Frame). In b the stuff added to the frame is not displayed correctly - but if I resize the window the display *is* correct. Questions: 1) Do I have to call wxFrame:show(Frame) *after* all controls have been added? 2) Is there come call I can make at the point just before I call loop/1 in b() which updates the window correctly? Cheers /Joe From erlang@REDACTED Sat Jul 8 11:01:00 2017 From: erlang@REDACTED (Joe Armstrong) Date: Sat, 8 Jul 2017 11:01:00 +0200 Subject: [erlang-questions] wxErlang question 4 Message-ID: This is my attempt at a minimal program which creates a button start() -> W = wx:new(), Frame = wxFrame:new(W, -1, "Hello"), Panel = wxScrolledWindow:new(Frame), Vbox = wxBoxSizer:new(?wxVERTICAL), wxWindow:setSizer(Panel, Vbox), Button = wxButton:new(Panel, 10, [{label,"Click"}]), wxSizer:add(Vbox, Button, [{flag, ?wxALL}]), wxFrame:show(Frame). It 1) gets a reference to the wxWindows Server 2) creates a Frame (which wxWindows calls a window) 3) adds a Panel to the frame a Panel is a thing you can add controls to 4) creates a Vbox (a box to whose children are arranged vertically) 5) tells the panel to use the Vbox as it's top level sizer 6) makes a button 7) adds the button to the Vbox 8) displays the frame Questions 1) Is my understanding of the steps you have to do be make a minimal window with a button correct? Could the code be clearer (how?) (actually shorter code might be possible but I want something that is extensible - so I've used a vbox to which I assume I can add more later) 2) What are the alternatives to wxScrolledWindow and to wxBoxSizer? Cheers /Joe From eric.pailleau@REDACTED Sat Jul 8 11:28:52 2017 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Sat, 8 Jul 2017 11:28:52 +0200 Subject: [erlang-questions] wxErlang - some answers In-Reply-To: References: Message-ID: Hello Joe, I'm particularly interested in XRC [1] standard. I think your effort, and efforts of people helping, may be a step to create XSLT templates to write wx abstract code to help people create easily wx UI without the huge effort to understand basics of wx. wx documentation is intimidating (well like was Erlang documentation first time I looked at it many years ago :) ...) but much harder than it to be able to write code quickly. Those templates could be a plugin in usual build tools to handle .xrc files, like asn1 file are handled to create code. If I can help, I will ! > > My intention is to try and decompose wxErlang into a large number of > small examples, where each example illustrates one feature of the > system. Also so show how to build complex examples from the small > parts. > > I'll make all the code available on github so you can join in the fun > (is this fun?). [1] http://docs.wxwidgets.org/trunk/overview_xrc.html From frank.muller.erl@REDACTED Sat Jul 8 11:44:07 2017 From: frank.muller.erl@REDACTED (Frank Muller) Date: Sat, 08 Jul 2017 09:44:07 +0000 Subject: [erlang-questions] wxErlang question 4 In-Reply-To: References: Message-ID: Joe, why not: start() -> Panel = wx:new("Hello"), Vbox = wxBoxSizer:new(?wxVERTICAL), wxWindow:setSizer(Panel, Vbox), Button = wxButton:new(Panel, 10, [{label,"Click"}]), wxSizer:add(Vbox, Button, [{flag, ?wxALL}]), wx:show(Panel). Where you hide the W and Frame inside the Panel. They're used only once/twice in your code!!! /Frank Le sam. 8 juil. 2017 ? 11:01, Joe Armstrong a ?crit : > This is my attempt at a minimal program which creates a button > > start() -> > W = wx:new(), > Frame = wxFrame:new(W, -1, "Hello"), > Panel = wxScrolledWindow:new(Frame), > Vbox = wxBoxSizer:new(?wxVERTICAL), > wxWindow:setSizer(Panel, Vbox), > Button = wxButton:new(Panel, 10, [{label,"Click"}]), > wxSizer:add(Vbox, Button, [{flag, ?wxALL}]), > wxFrame:show(Frame). > > It > 1) gets a reference to the wxWindows Server > 2) creates a Frame (which wxWindows calls a window) > 3) adds a Panel to the frame > a Panel is a thing you can add controls to > 4) creates a Vbox (a box to whose children are arranged vertically) > 5) tells the panel to use the Vbox as it's top level sizer > 6) makes a button > 7) adds the button to the Vbox > 8) displays the frame > > Questions > > 1) Is my understanding of the steps you have to do be make a > minimal window with a button correct? > > Could the code be clearer (how?) > > (actually shorter code might be possible but I want something that is > extensible - so I've used a vbox to which I assume I can add more > later) > > 2) What are the alternatives to wxScrolledWindow and to wxBoxSizer? > > Cheers > > /Joe > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Sat Jul 8 12:00:40 2017 From: erlang@REDACTED (Joe Armstrong) Date: Sat, 8 Jul 2017 12:00:40 +0200 Subject: [erlang-questions] wxErlang question 4 In-Reply-To: References: Message-ID: On Sat, Jul 8, 2017 at 11:44 AM, Frank Muller wrote: > Joe, why not: > > start() -> > Panel = wx:new("Hello"), > Vbox = wxBoxSizer:new(?wxVERTICAL), > wxWindow:setSizer(Panel, Vbox), > Button = wxButton:new(Panel, 10, [{label,"Click"}]), > wxSizer:add(Vbox, Button, [{flag, ?wxALL}]), > wx:show(Panel). > > > Where you hide the W and Frame inside the Panel. > They're used only once/twice in your code!!! Yes - bit I I want a minimal *extensible* solution - wx:new has (as I understand it) - a lot of side-effects and returns a reference that i can use to make other things. I could not (I guess) create two windows with the above. In my version you can say test() -> W = wx:new(), Frame1 = wxFrame:new(W,-1,"window1"), Frame2 = wxFrame:new(W,-1,"window2"), ... and get two windows Really I'd better naming so I'd say Frame = lib:make_frame(WinRef), Panel = lib:make_panel(Frame), Vbox = lib:make_vbox(Panel, ...) and strict rules about the order of adding things - I find the heavy overloading and inheritance rules terrible to understand /Joe > > /Frank > > > Le sam. 8 juil. 2017 ? 11:01, Joe Armstrong a ?crit : >> >> This is my attempt at a minimal program which creates a button >> >> start() -> >> W = wx:new(), >> Frame = wxFrame:new(W, -1, "Hello"), >> Panel = wxScrolledWindow:new(Frame), >> Vbox = wxBoxSizer:new(?wxVERTICAL), >> wxWindow:setSizer(Panel, Vbox), >> Button = wxButton:new(Panel, 10, [{label,"Click"}]), >> wxSizer:add(Vbox, Button, [{flag, ?wxALL}]), >> wxFrame:show(Frame). >> >> It >> 1) gets a reference to the wxWindows Server >> 2) creates a Frame (which wxWindows calls a window) >> 3) adds a Panel to the frame >> a Panel is a thing you can add controls to >> 4) creates a Vbox (a box to whose children are arranged vertically) >> 5) tells the panel to use the Vbox as it's top level sizer >> 6) makes a button >> 7) adds the button to the Vbox >> 8) displays the frame >> >> Questions >> >> 1) Is my understanding of the steps you have to do be make a >> minimal window with a button correct? >> >> Could the code be clearer (how?) >> >> (actually shorter code might be possible but I want something that is >> extensible - so I've used a vbox to which I assume I can add more >> later) >> >> 2) What are the alternatives to wxScrolledWindow and to wxBoxSizer? >> >> Cheers >> >> /Joe >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From albin.stigo@REDACTED Sat Jul 8 12:18:45 2017 From: albin.stigo@REDACTED (=?UTF-8?B?QWxiaW4gU3RpZ8O2?=) Date: Sat, 8 Jul 2017 12:18:45 +0200 Subject: [erlang-questions] Recommended way to crash gen_server Message-ID: Hello, I have a gen_server communicating with a port program I wrote in C. If I receive any unexpected data (or timeout) from the port I want to crash the gen_server. Regarding crashing, Is the recommended approach to return {stop, Reason} or should I exit(Reason) or maybe even throw(Reason). I want my supervisor to try to restart the gen_server according to the strategy/intensity I've chosen. --Albin From erlang@REDACTED Sat Jul 8 13:51:07 2017 From: erlang@REDACTED (Joe Armstrong) Date: Sat, 8 Jul 2017 13:51:07 +0200 Subject: [erlang-questions] wxErlang question5 Message-ID: How can I make a wxStaticBoxSizer that look like this. +- Text ------+ | Content | +-------------+ All the examples in wxErlang distribution look like this: Text Content ie without the frame /Joe From albin.stigo@REDACTED Sat Jul 8 14:11:24 2017 From: albin.stigo@REDACTED (=?UTF-8?B?QWxiaW4gU3RpZ8O2?=) Date: Sat, 8 Jul 2017 14:11:24 +0200 Subject: [erlang-questions] Erlang in healthcare or medical devices? Message-ID: Hello, Apologize if this is slightly of topic. I'm an anesthesiologist/programmer. I'm interested in the programming of medical information systems and devices. I have quite recently gotten seriously started in Erlang and am quite impressed with the system. I'm interested in working and pursuing research in this area. To get started I'm looking for some examples where people have successfully used Erlang in this field? --Albin From dangud@REDACTED Sat Jul 8 14:25:44 2017 From: dangud@REDACTED (Dan Gudmundsson) Date: Sat, 08 Jul 2017 12:25:44 +0000 Subject: [erlang-questions] wxErlang question5 In-Reply-To: References: Message-ID: I do think that is Macs way to display static box sizers, so I think the looks depends on the OS, the window manager theme. Den l?r 8 jul 2017 13:51Joe Armstrong skrev: > How can I make a wxStaticBoxSizer that look like this. > > +- Text ------+ > | Content | > +-------------+ > > All the examples in wxErlang distribution > look like this: > > Text > Content > > ie without the frame > > /Joe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karolis.velicka@REDACTED Sat Jul 8 14:38:45 2017 From: karolis.velicka@REDACTED (Karl Velicka) Date: Sat, 8 Jul 2017 13:38:45 +0100 Subject: [erlang-questions] Erlang in healthcare or medical devices? In-Reply-To: References: Message-ID: Hi Albin, This is probably the closest thing that I'm aware of: http://www.erlang-factory.com/euc2017/martin-sumner I see that the slides of the talk are available in the website I linked but it was being filmed too, so hopefully the video will be released at some point as well. All the best, Karl On 8 Jul 2017 13:23, "Albin Stig?" wrote: Hello, Apologize if this is slightly of topic. I'm an anesthesiologist/programmer. I'm interested in the programming of medical information systems and devices. I have quite recently gotten seriously started in Erlang and am quite impressed with the system. I'm interested in working and pursuing research in this area. To get started I'm looking for some examples where people have successfully used Erlang in this field? --Albin _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Sat Jul 8 15:14:05 2017 From: erlang@REDACTED (Joe Armstrong) Date: Sat, 8 Jul 2017 15:14:05 +0200 Subject: [erlang-questions] wxErlang question 6 - Image display Message-ID: Images wxWidgets is breaking the principle of least astonishment I've been making a load of widgets and adding them to a Vbox which arranges them in a vertical stack. To make a button Button = wxButton:new(Panel, Id, [{label,"My New Button"}]), wxSizer:add(Vbox, Button, ...) To make a text editor Button = wxTextCtrl:new(Panel, Id, ...), wxSizer:add(Vbox, Editor, ...) To make a combo box Combo = wxComboBox:new(Panel, Id, ..), wxSizer:add(Vbox, Combo, ...) and so on. At this point I began thinking "I'm beginng to understand this stuff" but ... I thought I'd add an image, so I tried this: Image = wxImage:new("image.jpg", []), wxSizer:add(Vbox, Image, ...) But oh dear - this doesn't work. I Googled a bit - and it appears I have to mess with paint events and graphics contexts and so on. But why? - why break the principle of least atonishment. Is it possible to dispay an Image in a Panel *without* handling graphics context and paint events? From mononcqc@REDACTED Sat Jul 8 15:42:22 2017 From: mononcqc@REDACTED (Fred Hebert) Date: Sat, 8 Jul 2017 09:42:22 -0400 Subject: [erlang-questions] Recommended way to crash gen_server In-Reply-To: References: Message-ID: <20170708134221.GH22798@ferdmbp.local> On 07/08, Albin Stig? wrote: >Regarding crashing, Is the recommended approach to return {stop, >Reason} or should I exit(Reason) or maybe even throw(Reason). I would go with {stop, Reason, State}, allowing the gen_server to clean up what it may need to (if at all). The Reason returned will be used by the behaviour to 'exit' the process all the same. Do note that the following reasons will *NOT* be seen as abnormal terminations, so a transient supervisor will not restart them: - normal - shutdown - {shutdown, Term} although the latter may be useful to document the type of normal expected exit that happened. From simonstl@REDACTED Sat Jul 8 15:46:14 2017 From: simonstl@REDACTED (Simon St.Laurent) Date: Sat, 8 Jul 2017 09:46:14 -0400 Subject: [erlang-questions] wxErlang question 4 In-Reply-To: References: Message-ID: Is there a repo with these micro-demos in progress? I'd like to play along. Thanks, Simon On 7/8/2017 6:00 AM, Joe Armstrong wrote: > On Sat, Jul 8, 2017 at 11:44 AM, Frank Muller > wrote: >> Joe, why not: >> >> start() -> >> Panel = wx:new("Hello"), >> Vbox = wxBoxSizer:new(?wxVERTICAL), >> wxWindow:setSizer(Panel, Vbox), >> Button = wxButton:new(Panel, 10, [{label,"Click"}]), >> wxSizer:add(Vbox, Button, [{flag, ?wxALL}]), >> wx:show(Panel). >> >> >> Where you hide the W and Frame inside the Panel. >> They're used only once/twice in your code!!! > Yes - bit I I want a minimal *extensible* solution - wx:new has (as I > understand it) - a > lot of side-effects and returns a reference that i can use to make other things. > > I could not (I guess) create two windows with the above. > > In my version you can say > > test() -> > W = wx:new(), > Frame1 = wxFrame:new(W,-1,"window1"), > Frame2 = wxFrame:new(W,-1,"window2"), > ... > > and get two windows > > Really I'd better naming so I'd say > > Frame = lib:make_frame(WinRef), > Panel = lib:make_panel(Frame), > Vbox = lib:make_vbox(Panel, ...) > > and strict rules about the order of adding things - I find the heavy > overloading and inheritance > rules terrible to understand > > /Joe > >> /Frank >> >> >> Le sam. 8 juil. 2017 ? 11:01, Joe Armstrong a ?crit : >>> This is my attempt at a minimal program which creates a button >>> >>> start() -> >>> W = wx:new(), >>> Frame = wxFrame:new(W, -1, "Hello"), >>> Panel = wxScrolledWindow:new(Frame), >>> Vbox = wxBoxSizer:new(?wxVERTICAL), >>> wxWindow:setSizer(Panel, Vbox), >>> Button = wxButton:new(Panel, 10, [{label,"Click"}]), >>> wxSizer:add(Vbox, Button, [{flag, ?wxALL}]), >>> wxFrame:show(Frame). >>> >>> It >>> 1) gets a reference to the wxWindows Server >>> 2) creates a Frame (which wxWindows calls a window) >>> 3) adds a Panel to the frame >>> a Panel is a thing you can add controls to >>> 4) creates a Vbox (a box to whose children are arranged vertically) >>> 5) tells the panel to use the Vbox as it's top level sizer >>> 6) makes a button >>> 7) adds the button to the Vbox >>> 8) displays the frame >>> >>> Questions >>> >>> 1) Is my understanding of the steps you have to do be make a >>> minimal window with a button correct? >>> >>> Could the code be clearer (how?) >>> >>> (actually shorter code might be possible but I want something that is >>> extensible - so I've used a vbox to which I assume I can add more >>> later) >>> >>> 2) What are the alternatives to wxScrolledWindow and to wxBoxSizer? >>> >>> Cheers >>> >>> /Joe >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From erlang@REDACTED Sat Jul 8 16:07:18 2017 From: erlang@REDACTED (Joe Armstrong) Date: Sat, 8 Jul 2017 16:07:18 +0200 Subject: [erlang-questions] wxErlang question 4 In-Reply-To: References: Message-ID: There will be - right now my thoughts are not well enough organised to create a set of meaningful examples - what I want to do (and am doing) is making a set of micro-examples each of which illustrates exactly one point. So far I have had some success with: buttons text editor areas vboxes and hboxes button click events graphics drawing menus comboboxes listboxes Images are not playing ball yet :-) I also want to add the built-in things like file selectors, color selectors, and make some things like tabbed dialogues. I also have problems with the fact that many of my programs appear to work but I do not understand why they work - and conversely many program that I think should work do not work. My problems with non-working programs is that I don't yet know enough to know]if a) the program is incorrect and should not work or b) the system is incorrect. At this stage I'm sending mails to the list asking specific questions - Anybody reading this thread should feel free to post questions and example programs. In particular very short programs that do very simple things, not complex programs that do many things. Cheers /Joe On Sat, Jul 8, 2017 at 3:46 PM, Simon St.Laurent wrote: > Is there a repo with these micro-demos in progress? I'd like to play along. > > Thanks, > Simon > > > > On 7/8/2017 6:00 AM, Joe Armstrong wrote: >> >> On Sat, Jul 8, 2017 at 11:44 AM, Frank Muller >> wrote: >>> >>> Joe, why not: >>> >>> start() -> >>> Panel = wx:new("Hello"), >>> Vbox = wxBoxSizer:new(?wxVERTICAL), >>> wxWindow:setSizer(Panel, Vbox), >>> Button = wxButton:new(Panel, 10, [{label,"Click"}]), >>> wxSizer:add(Vbox, Button, [{flag, ?wxALL}]), >>> wx:show(Panel). >>> >>> >>> Where you hide the W and Frame inside the Panel. >>> They're used only once/twice in your code!!! >> >> Yes - bit I I want a minimal *extensible* solution - wx:new has (as I >> understand it) - a >> lot of side-effects and returns a reference that i can use to make other >> things. >> >> I could not (I guess) create two windows with the above. >> >> In my version you can say >> >> test() -> >> W = wx:new(), >> Frame1 = wxFrame:new(W,-1,"window1"), >> Frame2 = wxFrame:new(W,-1,"window2"), >> ... >> >> and get two windows >> >> Really I'd better naming so I'd say >> >> Frame = lib:make_frame(WinRef), >> Panel = lib:make_panel(Frame), >> Vbox = lib:make_vbox(Panel, ...) >> >> and strict rules about the order of adding things - I find the heavy >> overloading and inheritance >> rules terrible to understand >> >> /Joe >> >>> /Frank >>> >>> >>> Le sam. 8 juil. 2017 ? 11:01, Joe Armstrong a ?crit : >>>> >>>> This is my attempt at a minimal program which creates a button >>>> >>>> start() -> >>>> W = wx:new(), >>>> Frame = wxFrame:new(W, -1, "Hello"), >>>> Panel = wxScrolledWindow:new(Frame), >>>> Vbox = wxBoxSizer:new(?wxVERTICAL), >>>> wxWindow:setSizer(Panel, Vbox), >>>> Button = wxButton:new(Panel, 10, [{label,"Click"}]), >>>> wxSizer:add(Vbox, Button, [{flag, ?wxALL}]), >>>> wxFrame:show(Frame). >>>> >>>> It >>>> 1) gets a reference to the wxWindows Server >>>> 2) creates a Frame (which wxWindows calls a window) >>>> 3) adds a Panel to the frame >>>> a Panel is a thing you can add controls to >>>> 4) creates a Vbox (a box to whose children are arranged vertically) >>>> 5) tells the panel to use the Vbox as it's top level sizer >>>> 6) makes a button >>>> 7) adds the button to the Vbox >>>> 8) displays the frame >>>> >>>> Questions >>>> >>>> 1) Is my understanding of the steps you have to do be make a >>>> minimal window with a button correct? >>>> >>>> Could the code be clearer (how?) >>>> >>>> (actually shorter code might be possible but I want something that >>>> is >>>> extensible - so I've used a vbox to which I assume I can add more >>>> later) >>>> >>>> 2) What are the alternatives to wxScrolledWindow and to wxBoxSizer? >>>> >>>> Cheers >>>> >>>> /Joe >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From jesper.louis.andersen@REDACTED Sat Jul 8 17:23:39 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sat, 08 Jul 2017 15:23:39 +0000 Subject: [erlang-questions] Erlang in healthcare or medical devices? In-Reply-To: References: Message-ID: Another slightly relevant project is the one running the danish pharmacy prescriptions. It is relevant for discussion as there are some unique properties people tend to want out of such a system: - High resilience. It can be fatal if prescriptions doesn't work for some people. Thus, the system must be able to handle itself in case of partial failure of some parts. - Clear audit trail. It should be possible to know what happened to a given prescription. Interestingly, Richard Cook--also an anesthesiologist by trade--has written some of the best work on complex system architectures: http://web.mit.edu/2.75/resources/random/How%20Complex%20Systems%20Fail.pdf His main point is that any complex system must be able to adapt in order to have correct operation. On Sat, Jul 8, 2017 at 2:58 PM Karl Velicka wrote: > Hi Albin, > > This is probably the closest thing that I'm aware of: > > http://www.erlang-factory.com/euc2017/martin-sumner > > I see that the slides of the talk are available in the website I linked > but it was being filmed too, so hopefully the video will be released at > some point as well. > > > All the best, > Karl > > > On 8 Jul 2017 13:23, "Albin Stig?" wrote: > > Hello, > > Apologize if this is slightly of topic. > > I'm an anesthesiologist/programmer. I'm interested in the programming > of medical information systems and devices. I have quite recently > gotten seriously started in Erlang and am quite impressed with the > system. > > I'm interested in working and pursuing research in this area. To get > started I'm looking for some examples where people have successfully > used Erlang in this field? > > > --Albin > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathaniel@REDACTED Sat Jul 8 17:40:59 2017 From: nathaniel@REDACTED (Nathaniel Waisbrot) Date: Sat, 8 Jul 2017 11:40:59 -0400 Subject: [erlang-questions] Erlang in healthcare or medical devices? In-Reply-To: References: Message-ID: <095881F7-5460-4C88-BA07-2097F9F6B532@waisbrot.net> > I'm an anesthesiologist/programmer. I'm interested in the programming > of medical information systems and devices. I have quite recently > gotten seriously started in Erlang and am quite impressed with the > system. > > I'm interested in working and pursuing research in this area. To get > started I'm looking for some examples where people have successfully > used Erlang in this field? I worked at one company that did healthcare-focused text messaging and we used ejabberd. Reliable delivery despite flakey Internet on mobile devices was key and Erlang was helpful in expressing that constraint. I was at another where we made a fitness wearable device and used Erlang for the server-side handling of biometric data. The important thing there was to route relatively small amounts of binary data with low latency. That was a pretty obvious fit for Erlang, and matching on binary data in Erlang is always fun. From albin.stigo@REDACTED Sat Jul 8 19:07:15 2017 From: albin.stigo@REDACTED (=?UTF-8?B?QWxiaW4gU3RpZ8O2?=) Date: Sat, 8 Jul 2017 19:07:15 +0200 Subject: [erlang-questions] Erlang in healthcare or medical devices? In-Reply-To: References: Message-ID: That's really interesting! I have actually read that paper but was not aware that he's also an anesthesiologist. Will definitively look more Also very interested to learn that FMK is implemented in Erlang... I have actually used that system as I did part of my training in Denmark. What I haven't found so far is medical hardware using Erlang internally... --Albin On Sat, Jul 8, 2017 at 5:23 PM, Jesper Louis Andersen wrote: > Another slightly relevant project is the one running the danish pharmacy > prescriptions. It is relevant for discussion as there are some unique > properties people tend to want out of such a system: > > - High resilience. It can be fatal if prescriptions doesn't work for some > people. Thus, the system must be able to handle itself in case of partial > failure of some parts. > - Clear audit trail. It should be possible to know what happened to a given > prescription. > > Interestingly, Richard Cook--also an anesthesiologist by trade--has written > some of the best work on complex system architectures: > http://web.mit.edu/2.75/resources/random/How%20Complex%20Systems%20Fail.pdf > > His main point is that any complex system must be able to adapt in order to > have correct operation. > > On Sat, Jul 8, 2017 at 2:58 PM Karl Velicka > wrote: >> >> Hi Albin, >> >> This is probably the closest thing that I'm aware of: >> >> http://www.erlang-factory.com/euc2017/martin-sumner >> >> I see that the slides of the talk are available in the website I linked >> but it was being filmed too, so hopefully the video will be released at some >> point as well. >> >> >> All the best, >> Karl >> >> >> On 8 Jul 2017 13:23, "Albin Stig?" wrote: >> >> Hello, >> >> Apologize if this is slightly of topic. >> >> I'm an anesthesiologist/programmer. I'm interested in the programming >> of medical information systems and devices. I have quite recently >> gotten seriously started in Erlang and am quite impressed with the >> system. >> >> I'm interested in working and pursuing research in this area. To get >> started I'm looking for some examples where people have successfully >> used Erlang in this field? >> >> >> --Albin >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From albin.stigo@REDACTED Sat Jul 8 19:08:13 2017 From: albin.stigo@REDACTED (=?UTF-8?B?QWxiaW4gU3RpZ8O2?=) Date: Sat, 8 Jul 2017 19:08:13 +0200 Subject: [erlang-questions] Erlang in healthcare or medical devices? In-Reply-To: <095881F7-5460-4C88-BA07-2097F9F6B532@waisbrot.net> References: <095881F7-5460-4C88-BA07-2097F9F6B532@waisbrot.net> Message-ID: Working with binary matching in Erlang is one of my favourite things. It's so easy to interface to hardware/protocols. --Albin On Sat, Jul 8, 2017 at 5:40 PM, Nathaniel Waisbrot wrote: >> I'm an anesthesiologist/programmer. I'm interested in the programming >> of medical information systems and devices. I have quite recently >> gotten seriously started in Erlang and am quite impressed with the >> system. >> >> I'm interested in working and pursuing research in this area. To get >> started I'm looking for some examples where people have successfully >> used Erlang in this field? > > > I worked at one company that did healthcare-focused text messaging and we used ejabberd. Reliable delivery despite flakey Internet on mobile devices was key and Erlang was helpful in expressing that constraint. > I was at another where we made a fitness wearable device and used Erlang for the server-side handling of biometric data. The important thing there was to route relatively small amounts of binary data with low latency. That was a pretty obvious fit for Erlang, and matching on binary data in Erlang is always fun. From silviu.cpp@REDACTED Sat Jul 8 20:21:59 2017 From: silviu.cpp@REDACTED (Caragea Silviu) Date: Sat, 8 Jul 2017 21:21:59 +0300 Subject: [erlang-questions] on_load behaviour in OTP 20 Message-ID: Hello, In some of my projects I have modules dynamically compiled. In order to avoid static analyzers warning I had used a stub module. And also in order to avoid when doing hot-swap releases to have the stubs reloaded and overwriting the code I used on_load that returns something different than ok. Unfortunatly this seems no longer working in OTP 20 as time : In embedded mode, first all modules are loaded. Then all on_load functions are called. The system is terminated unless all of the on_load functions return ok. My stub is as follow: -module(erlpool_globals). %% Module stub. %% Will be replaced by the module with the same name at runtime. %% The only purpose for the module is to suppress warnings from code analyzers, %% as dynamically compiled module is not available during the build. -export([]). -on_load(do_not_load/0). do_not_load() -> do_not_load. In OTP < 20 works fine. In 20 is not. The app crashes at startup if the relase is done using {profile, standalone}, or {profile, embedded} Any workarounds ? Silviu -------------- next part -------------- An HTML attachment was scrubbed... URL: From silviu.cpp@REDACTED Sat Jul 8 20:40:50 2017 From: silviu.cpp@REDACTED (Caragea Silviu) Date: Sat, 8 Jul 2017 21:40:50 +0300 Subject: [erlang-questions] on_load behaviour in OTP 20 In-Reply-To: References: Message-ID: Sorry profile doesn't matter. The one that meters is Code Loading Strategy : In OTP < 20 both -mode interactive and -mode embedded works In OTP20 only -mode interactive works Silviu On Sat, Jul 8, 2017 at 9:21 PM, Caragea Silviu wrote: > Hello, > > In some of my projects I have modules dynamically compiled. In order to > avoid static analyzers warning I had used a stub module. And also in order > to avoid when doing hot-swap releases to have the stubs reloaded and > overwriting the code I used on_load that returns something different than > ok. > > Unfortunatly this seems no longer working in OTP 20 as time : In embedded > mode, first all modules are loaded. Then all on_load functions are > called. The system is terminated unless all of the on_load functions > return ok. > > My stub is as follow: > > -module(erlpool_globals). > > %% Module stub. > %% Will be replaced by the module with the same name at runtime. > %% The only purpose for the module is to suppress warnings from code analyzers, > %% as dynamically compiled module is not available during the build. > > -export([]). > > -on_load(do_not_load/0). > > do_not_load() -> > do_not_load. > > In OTP < 20 works fine. In 20 is not. The app crashes at startup if the relase is done using > {profile, standalone}, or {profile, embedded} > > Any workarounds ? > > Silviu > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From james@REDACTED Sat Jul 8 21:08:47 2017 From: james@REDACTED (james) Date: Sat, 8 Jul 2017 20:08:47 +0100 Subject: [erlang-questions] wxErlang In-Reply-To: References: Message-ID: <23d9ae6a-5cc9-8c0d-fc1b-1181d167f0eb@mansionfamily.plus.com> > Actually they are inherently concurrent - you can think of toggle > buttons as processes I disagree. When I click two buttons I expect the side effects to occur synchronously and for the effects of my actions to occur in exactly the order in which I click and with no race conditions introduced by technology behind the scenes. The UI is a representation of state and I am directly manipulating it. Display of async events from external sources, which is inherently racey with me, that's another matter. Your messaging analogy only works if there is a way to allow the system to quiesce and the visuals update before the user can make another action, or to force all UI events to go through a single queue and to ensure that the 'button clicked' message has been placed in that queue before the user can interact again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vladdu55@REDACTED Sat Jul 8 21:10:48 2017 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Sat, 8 Jul 2017 21:10:48 +0200 Subject: [erlang-questions] wxErlang - some answers In-Reply-To: References: Message-ID: Hi Joe, I wonder -- from this point of view of the APIs, what do you think of the now defunct `gs` application? People have given good feedback, but I will add my 2c too. There are several issues to solve. One issue is "how do I put the GUI together?", which IMHO is best done declaratively. With an adequate language, even dynamic UIs can be described. This is relatively easy. The second issue is handling the state: bot the application state (what the real app needs to know from the inputs) and the GUI state (for example, a checkbox controlling the enabled state of the rest of the controls on the page; or an input validator for the whole UI). The latter is the tricky one, in my experience, as some entity needs to have the whole state available. Updates to this states need to be observed, which is not easy to do correctly (see even below). Then there is the issue of performance, again two-sided: - we'd like to be able to use native controls/widgets, but allow custom ones too. Here we also stumble upon supporting all OSs and graphics frameworks. - updating the UI needs to be done at the appropriate moments, i.e. if needed and not more often than the display can update itself. There is one technology that is available everywhere, has optimized rendering and is reasonably easy to adapt and adapt to: HTML. With frameworks like Electron (https://electron.atom.io/), it is available on the desktop and with the full power of JavaScript. Web components are on the rise and there are libraries (vue.js, https://vuejs.org/, for example) that make them easy to build and reason about. The remaining issue however is an interesting hurdle: how to interface JS with Erlang? There have been interesting projects for that (like beam.js and erlv8), but I can't find any active one - it would be interesting to know what what the reason was for not continuing the work. best regards, Vlad On Sat, Jul 8, 2017 at 11:28 AM, PAILLEAU Eric wrote: > Hello Joe, > > I'm particularly interested in XRC [1] standard. > > I think your effort, and efforts of people helping, may be a step to > create XSLT templates to write wx abstract code to help people create > easily wx UI without the huge effort to understand basics of wx. > wx documentation is intimidating (well like was Erlang documentation first > time I looked at it many years ago :) ...) but much harder than it to be > able to write code quickly. > > Those templates could be a plugin in usual build tools to handle .xrc > files, like asn1 file are handled to create code. > > If I can help, I will ! > > >> My intention is to try and decompose wxErlang into a large number of >> small examples, where each example illustrates one feature of the >> system. Also so show how to build complex examples from the small >> parts. >> >> I'll make all the code available on github so you can join in the fun >> (is this fun?). >> > > [1] http://docs.wxwidgets.org/trunk/overview_xrc.html > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eshikafe@REDACTED Sun Jul 9 08:41:03 2017 From: eshikafe@REDACTED (austin aigbe) Date: Sun, 9 Jul 2017 07:41:03 +0100 Subject: [erlang-questions] diameter_make compilation issues for 3GPP Diameter Commands Message-ID: Hello, It seems the Erlang Diameter dictionary compiler (diameter_make) is not compatible with the 3GPP Diameter commands. When I try compiling the attached .dia file, for Cx (3GPP TS 29.299 v12.7.0), I get the following error: 10> diameter_make:codec("cx_ts29229_v1270.dia",[hrl]). {error,{invalid_avp_order,[123,"Destination-Realm",125,95]}} ------------------------- @messages UAR ::= < Diameter Header: 300, REQ, PXY > < Session-Id > { Vendor-Specific-Application-Id } { Auth-Session-State } { Origin-Host } { Origin-Realm } [ Destination-Host ] * { Destination-Realm }* { User-Name } ---------------------------- Or am I doing something wrong? Kindly advise. Erlang version: Erlang/OTP 20 [erts-9.0] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] Eshell V9.0 (abort with ^G) Thanks. Regards, Austin -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: cx_ts29229_v1270.dia Type: application/octet-stream Size: 9184 bytes Desc: not available URL: From erlang@REDACTED Sun Jul 9 10:34:13 2017 From: erlang@REDACTED (Joe Armstrong) Date: Sun, 9 Jul 2017 10:34:13 +0200 Subject: [erlang-questions] wxErlang - some answers In-Reply-To: References: Message-ID: On Sat, Jul 8, 2017 at 9:10 PM, Vlad Dumitrescu wrote: > Hi Joe, > > I wonder -- from this point of view of the APIs, what do you think of the > now defunct `gs` application? Hello Vlad, I'd always liked gs - the trouble seems to be (I might be wrong here) that TCL/Tk is no longer popular and untrendy. Also my impression was that the GUI's you could make deviated from the current look-and-feel that people expect. > > People have given good feedback, but I will add my 2c too. There are several > issues to solve. > > One issue is "how do I put the GUI together?", which IMHO is best done > declaratively. With an adequate language, even dynamic UIs can be described. > This is relatively easy. I agree - actually wxWidgets has hboxes and vboxes so this should be "relatively" easy. Relatively being a relative term here :-) > The second issue is handling the state: bot the application state (what the > real app needs to know from the inputs) and the GUI state (for example, a > checkbox controlling the enabled state of the rest of the controls on the > page; or an input validator for the whole UI). The latter is the tricky one, > in my experience, as some entity needs to have the whole state available. > Updates to this states need to be observed, which is not easy to do > correctly (see even below). Yes - I see this as a concurrency problem. If all the controls on the GUI either send or respond to messages is the control program one or several processes? > > Then there is the issue of performance, again two-sided: > - we'd like to be able to use native controls/widgets, but allow custom ones > too. Here we also stumble upon supporting all OSs and graphics frameworks. > - updating the UI needs to be done at the appropriate moments, i.e. if > needed and not more often than the display can update itself. Tricky > > There is one technology that is available everywhere, has optimized > rendering and is reasonably easy to adapt and adapt to: HTML. With > frameworks like Electron (https://electron.atom.io/), it is available on the > desktop and with the full power of JavaScript. Web components are on the > rise and there are libraries (vue.js, https://vuejs.org/, for example) that > make them easy to build and reason about. The remaining issue however is an > interesting hurdle: how to interface JS with Erlang? There have been > interesting projects for that (like beam.js and erlv8), but I can't find any > active one - it would be interesting to know what what the reason was for > not continuing the work. Ummm - the problem with web technologies is the gigantic size and complexity of everything - webkit + JS is great - but huge. The problem is what I want is (say) a graphics widget that responds to messages containing SVG - and NOTHING ELSE. This is *easy* to do in the browser BUT I get a lot of other stuff that I don't want. I think I once found a project that bundled a web browser canvas + JS into a single program with nothing else - this would be great if it exists. The thing I'd like would have (say) the web browser canvas object, JS and a socket support. When looking for wxWidgets examples I stumbled over wxLua - which looks like a good source of inspiration (has anybody reading this used wXLua???) Cheers /Joe > > best regards, > Vlad > > > On Sat, Jul 8, 2017 at 11:28 AM, PAILLEAU Eric > wrote: >> >> Hello Joe, >> >> I'm particularly interested in XRC [1] standard. >> >> I think your effort, and efforts of people helping, may be a step to >> create XSLT templates to write wx abstract code to help people create easily >> wx UI without the huge effort to understand basics of wx. >> wx documentation is intimidating (well like was Erlang documentation first >> time I looked at it many years ago :) ...) but much harder than it to be >> able to write code quickly. >> >> Those templates could be a plugin in usual build tools to handle .xrc >> files, like asn1 file are handled to create code. >> >> If I can help, I will ! >> >>> >>> My intention is to try and decompose wxErlang into a large number of >>> small examples, where each example illustrates one feature of the >>> system. Also so show how to build complex examples from the small >>> parts. >>> >>> I'll make all the code available on github so you can join in the fun >>> (is this fun?). >> >> >> [1] http://docs.wxwidgets.org/trunk/overview_xrc.html >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > From ferenc.holzhauser@REDACTED Sun Jul 9 11:21:46 2017 From: ferenc.holzhauser@REDACTED (Ferenc Holzhauser) Date: Sun, 9 Jul 2017 11:21:46 +0200 Subject: [erlang-questions] diameter_make compilation issues for 3GPP Diameter Commands In-Reply-To: References: Message-ID: Hi, As the error message suggests, the problem is most likely that the optional [ Destination-Host ] AVP is on the wrong spot in the message definition. According to the Diameter Base Protocol spec (RFC 6733, Chapter 3.2) the sequence of AVPs after the header should be : fixed ( <...> ) , required ( {...} ) , optional ( [...] ). You should probably fix the message definition to follow this order. My experience with picking message definitions from 3GPP diameter protocol specs is that they almost always need (sometimes significant) handcrafting to work. Regards, Ferenc On 9 July 2017 at 08:41, austin aigbe wrote: > Hello, > > It seems the Erlang Diameter dictionary compiler (diameter_make) is not > compatible with the 3GPP Diameter commands. > > When I try compiling the attached .dia file, for Cx (3GPP TS 29.299 > v12.7.0), I get the following error: > > 10> diameter_make:codec("cx_ts29229_v1270.dia",[hrl]). > {error,{invalid_avp_order,[123,"Destination-Realm",125,95]}} > > ------------------------- > @messages > > UAR ::= < Diameter Header: 300, REQ, PXY > > < Session-Id > > { Vendor-Specific-Application-Id } > { Auth-Session-State } > { Origin-Host } > { Origin-Realm } > [ Destination-Host ] > * { Destination-Realm }* > { User-Name } > ---------------------------- > > Or am I doing something wrong? Kindly advise. > > Erlang version: > > Erlang/OTP 20 [erts-9.0] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] > > Eshell V9.0 (abort with ^G) > > Thanks. > > Regards, > Austin > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aseigo@REDACTED Sun Jul 9 23:03:23 2017 From: aseigo@REDACTED (Aaron Seigo) Date: Sun, 09 Jul 2017 23:03:23 +0200 Subject: [erlang-questions] Erlang in healthcare or medical devices? In-Reply-To: References: Message-ID: <29a5c76a136453fec2a9cadec08300eb@mykolab.com> On 8.7.2017 19:07, Albin Stig? wrote: > What I haven't found so far is medical hardware using Erlang > internally... I don't know of any myself, but this may be a decent place to start looking for your own projects should you begin to dig in: http://nerves-project.org/ It uses Elixir, but that means the BEAM and Erlang are right there as well. It seems to have quite a head of steam on it at the moment, and is certainly worth a look! Would be great to see the BEAM on medical devices .. it's about time, really! -- Aaron Seigo From abhishek@REDACTED Mon Jul 10 09:42:55 2017 From: abhishek@REDACTED (Abhishek Ranjan) Date: Mon, 10 Jul 2017 13:12:55 +0530 (IST) Subject: [erlang-questions] Can't fill in the mnesia table Message-ID: <2086029294.24986.1499672575325@webmail.blacklightsw.com> I wrote this code snippet: Player=t:user(List), CatchAll=[{'_',[],['$_']}], NameList=mnesia:dirty_select(player, CatchAll), if (length(NameList)<4)-> T3 = fun() -> X3 = #player{name=Player }, mnesia:write(X3) end, mnesia:transaction(T3), NameList1=mnesia:dirty_select(player, CatchAll), ?io:format("1The value of NameList1 is ~p~n",[NameList1]), ok; (length(NameList)==4)-> ?io:format("2The value of NameList is ~p~n",[NameList]) end, Here, each time a call a module t:user I get a name which i have stored in Player and want to keep storing these names till there are 4 of them but each i time I run this I get an empty value of Namelist as [], instead of a list filled with players name. Any Idea on why this is happening? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dszoboszlay@REDACTED Mon Jul 10 16:46:56 2017 From: dszoboszlay@REDACTED (=?UTF-8?Q?D=C3=A1niel_Szoboszlay?=) Date: Mon, 10 Jul 2017 14:46:56 +0000 Subject: [erlang-questions] Can't fill in the mnesia table In-Reply-To: <2086029294.24986.1499672575325@webmail.blacklightsw.com> References: <2086029294.24986.1499672575325@webmail.blacklightsw.com> Message-ID: Hi, Your code works for me (apart from the obvious race condition that you may end up with more than 4 records in the table if at least two processes execute the code concurrently), so my best guess is that the mnesia:transaction(T3) call fails in your database for some reason. Try capturing it's return value and adding it to the debug printout! Cheers, Daniel On Mon, 10 Jul 2017 at 09:43 Abhishek Ranjan wrote: > I wrote this code snippet: > > *Player=t:user(List), > CatchAll=[{'_',[],['$_']}], > NameList=mnesia:dirty_select(player, CatchAll), > if > (length(NameList)<4)-> > T3 = fun() -> > X3 = #player{name=Player > }, > mnesia:write(X3) > end, > mnesia:transaction(T3), > NameList1=mnesia:dirty_select(player, CatchAll), > ?io:format("1The value of NameList1 is ~p~n",[NameList1]), > ok; > (length(NameList)==4)-> > ?io:format("2The value of NameList is ~p~n",[NameList]) > end, * > > Here, each time a call a module t:user I get a name which i have stored in > Player and want to keep storing these names till there are 4 of them but > each i time I run this I get an empty value of Namelist as [], instead of a > list filled with players name. > > Any Idea on why this is happening? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cloudzen@REDACTED Mon Jul 10 18:11:08 2017 From: cloudzen@REDACTED (skyman) Date: Tue, 11 Jul 2017 00:11:08 +0800 (CST) Subject: [erlang-questions] How to implement the A Star find path algorithm using NIF? Message-ID: <1021d0a4.ce48.15d2d44c7d7.Coremail.cloudzen@163.com> Hi everybody, Our game is using A Star algorithm to find path. For performance I want to write it in C language, and Erlang calls it by NIF. I don't know whether the map data is maintained in C or in Erlang. Can anyone tell me? In addition, is there any better solution than NIF? Thanks very much! -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Mon Jul 10 18:23:51 2017 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Mon, 10 Jul 2017 19:23:51 +0300 Subject: [erlang-questions] VM with 32MB RAM Message-ID: <14B139DB-9EF9-4F64-A668-D29030D274A0@gmail.com> Hello, I?ve never raise a memory concern for Erlang application in the cloud. Recently, I though to fit as many independent Erlang releases as possible into cloud container cluster (AWS ECS). The memory is one of the dimension you have to control and provision, you need to declare application initial RAM and reserve its expansion. Reading the Erlang documentation http://erlang.org/faq/implementations.html "People successfully run the Ericsson implementation of Erlang on systems with as little as 16MByte of RAM. It is reasonably straightforward to fit Erlang itself into 2MByte of persistent storage (e.g. a flash disk)." The VM claims significant amount of `system` memory when release is booted with embedded code loading strategy. For example a simples web echo server might require up to 45MB of memory with total initial memory budget for the application over 50MB. The interactive code loading strategy relax `system` memory consumption to 18MB with total application budget under 32MB. The `system` memory do not grow significantly (+/- 5MB) during the life cycle of this application. Here is some questions * Why there is such huge difference of system memory usage between embedded and interactive code loading strategy? It seems to me that embedded model load almost OTP libraries into memory even half of them are really used in the application? * The default code loading strategy is interactive for OTP but relx makes it embedded. Why? https://github.com/erlware/relx/blob/master/priv/templates/extended_bin#L37 * What is your experience to use interactive code loading in the CLOUD production systems? Frankly speaking, I?ve always used embedded mode. * Do you see an other techniques to reduce memory consumption besides 32-bit system and half-word emulator? Best Regards, Dmitry From dmkolesnikov@REDACTED Mon Jul 10 18:33:34 2017 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Mon, 10 Jul 2017 19:33:34 +0300 Subject: [erlang-questions] How to implement the A Star find path algorithm using NIF? In-Reply-To: <1021d0a4.ce48.15d2d44c7d7.Coremail.cloudzen@163.com> References: <1021d0a4.ce48.15d2d44c7d7.Coremail.cloudzen@163.com> Message-ID: <2B04763C-2822-419C-A7EB-FFAFD721C1E9@gmail.com> Hello, > On 10 Jul 2017, at 19.11, skyman wrote: > > Hi everybody, > > Our game is using A Star algorithm to find path. For performance I want to write it in C language, and Erlang calls it by NIF. I don't know whether the map data is maintained in C or in Erlang. Can anyone tell me? Map is native data structure. However, you need to use enif interface to interact with it. http://erlang.org/doc/man/erl_nif.html#enif_get_map_value > In addition, is there any better solution than NIF? I?ve used to solve a ?routing? issues on pure Erlang using ETS, lists, etc. However, this mainly depends on your traffic, latency and size of routing tables. It is hard to give a straight forward answer not knowing this figures. > > Thanks very much! Best Regards, Dmitry -------------- next part -------------- An HTML attachment was scrubbed... URL: From cloudzen@REDACTED Mon Jul 10 19:03:33 2017 From: cloudzen@REDACTED (skyman) Date: Tue, 11 Jul 2017 01:03:33 +0800 (CST) Subject: [erlang-questions] How to implement the A Star find path algorithm using NIF? In-Reply-To: <2B04763C-2822-419C-A7EB-FFAFD721C1E9@gmail.com> References: <1021d0a4.ce48.15d2d44c7d7.Coremail.cloudzen@163.com> <2B04763C-2822-419C-A7EB-FFAFD721C1E9@gmail.com> Message-ID: <4871f71b.27.15d2d74c56b.Coremail.cloudzen@163.com> Hi Dmitry, Thanks for your reply. The map of our game is large(1000 * 1000 grids). If I use NIF to implement the A Star find path in C, can I allocate the map grid array(1000 * 1000) in C, and when map blocks changed, Erlang calls 'updateBlock' NIF to update the grid state in grid array in C? Thanks! At 2017-07-11 00:33:34, "Dmitry Kolesnikov" wrote: Hello, On 10 Jul 2017, at 19.11, skyman wrote: Hi everybody, Our game is using A Star algorithm to find path. For performance I want to write it in C language, and Erlang calls it by NIF. I don't know whether the map data is maintained in C or in Erlang. Can anyone tell me? Map is native data structure. However, you need to use enif interface to interact with it. http://erlang.org/doc/man/erl_nif.html#enif_get_map_value In addition, is there any better solution than NIF? I?ve used to solve a ?routing? issues on pure Erlang using ETS, lists, etc. However, this mainly depends on your traffic, latency and size of routing tables. It is hard to give a straight forward answer not knowing this figures. Thanks very much! Best Regards, Dmitry -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Mon Jul 10 19:32:31 2017 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Mon, 10 Jul 2017 20:32:31 +0300 Subject: [erlang-questions] How to implement the A Star find path algorithm using NIF? In-Reply-To: <4871f71b.27.15d2d74c56b.Coremail.cloudzen@163.com> References: <1021d0a4.ce48.15d2d44c7d7.Coremail.cloudzen@163.com> <2B04763C-2822-419C-A7EB-FFAFD721C1E9@gmail.com> <4871f71b.27.15d2d74c56b.Coremail.cloudzen@163.com> Message-ID: Hello, It looks you are trying to implement a hybrid solution a mix up of Erlang and C code for routing. Unless, I?ve not understood your question. I would either implement A* purely native or purely in Erlang. In both cases, I would target a data structure that best suites your problem and implementation techniques. Let?s say, you?ve made decision to implement A* in C then I would design a NIF API to address problem of A* search rather then memory management. In this case the updateBlock routine becomes internal for your C code. BTW, Have you consider to use Cpp and NIFpp wrapper for Erlang to integrate existed A* algorithms ? Best Regards, Dmitry > On 10 Jul 2017, at 20.03, skyman wrote: > > Hi Dmitry, > > Thanks for your reply. > The map of our game is large(1000 * 1000 grids). If I use NIF to implement the A Star find path in C, can I allocate the map grid array(1000 * 1000) in C, and when map blocks changed, Erlang calls 'updateBlock' NIF to update the grid state in grid array in C? > > Thanks! > > > > > At 2017-07-11 00:33:34, "Dmitry Kolesnikov" wrote: > Hello, > >> On 10 Jul 2017, at 19.11, skyman > wrote: >> >> Hi everybody, >> >> Our game is using A Star algorithm to find path. For performance I want to write it in C language, and Erlang calls it by NIF. I don't know whether the map data is maintained in C or in Erlang. Can anyone tell me? > > Map is native data structure. However, you need to use enif interface to interact with it. > http://erlang.org/doc/man/erl_nif.html#enif_get_map_value >> In addition, is there any better solution than NIF? > > I?ve used to solve a ?routing? issues on pure Erlang using ETS, lists, etc. However, this mainly depends on your traffic, latency and size of routing tables. It is hard to give a straight forward answer not knowing this figures. > > >> >> Thanks very much! > > Best Regards, > Dmitry > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Mon Jul 10 19:38:08 2017 From: mononcqc@REDACTED (Fred Hebert) Date: Mon, 10 Jul 2017 13:38:08 -0400 Subject: [erlang-questions] Do you know what your code is doing at night? Message-ID: <20170710173806.GI22798@ferdmbp.local> Hello everyone, If you've been curious about property-based testing for a while but found it kind of intimidating or didn't really feel like digging in the source or asking bloggers or people who implement their own libraries to get going, I've got a thing you might like. I've been assembling my own notes on property-based testing over the last few months, and have just made http://propertesting.com/ public, even if it is not fully complete yet. Hopefully, if you're one of those people who want to figure out what the properties of their code is or you want to make sure they're actually enforced properly, this could be of help. Have a read and let me know what you think. Regards, Fred. From rtrlists@REDACTED Mon Jul 10 20:08:00 2017 From: rtrlists@REDACTED (Robert Raschke) Date: Mon, 10 Jul 2017 20:08:00 +0200 Subject: [erlang-questions] VM with 32MB RAM In-Reply-To: References: <14B139DB-9EF9-4F64-A668-D29030D274A0@gmail.com> Message-ID: Hi Dmitry, if I remember correctly, the embedded mode loads all code for the required applications of your system, whereas interactive loads modules as required. The embedded approach has the benefit of knowing exactly how much memory your code takes up. As well as moving the loading to the start. For specialist systems, you could create cut down versions of your applications to only include the modules you are actually using. You are likely to need all of kernel, but beyond that there is scope for minimization ? No idea though why embedded mode would be default for relx. Personally, unless I had good reason to otherwise, I'd always opt for interactive. Biggest downside is missing code you only get told about late. Hope this helps, Robby On 10 Jul 2017 18:23, "Dmitry Kolesnikov" wrote: Hello, I?ve never raise a memory concern for Erlang application in the cloud. Recently, I though to fit as many independent Erlang releases as possible into cloud container cluster (AWS ECS). The memory is one of the dimension you have to control and provision, you need to declare application initial RAM and reserve its expansion. Reading the Erlang documentation http://erlang.org/faq/implementations.html "People successfully run the Ericsson implementation of Erlang on systems with as little as 16MByte of RAM. It is reasonably straightforward to fit Erlang itself into 2MByte of persistent storage (e.g. a flash disk)." The VM claims significant amount of `system` memory when release is booted with embedded code loading strategy. For example a simples web echo server might require up to 45MB of memory with total initial memory budget for the application over 50MB. The interactive code loading strategy relax `system` memory consumption to 18MB with total application budget under 32MB. The `system` memory do not grow significantly (+/- 5MB) during the life cycle of this application. Here is some questions * Why there is such huge difference of system memory usage between embedded and interactive code loading strategy? It seems to me that embedded model load almost OTP libraries into memory even half of them are really used in the application? * The default code loading strategy is interactive for OTP but relx makes it embedded. Why? https://github.com/erlware/relx/blob/master/priv/templates/extended_bin#L37 * What is your experience to use interactive code loading in the CLOUD production systems? Frankly speaking, I?ve always used embedded mode. * Do you see an other techniques to reduce memory consumption besides 32-bit system and half-word emulator? Best Regards, Dmitry _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From albin.stigo@REDACTED Mon Jul 10 20:11:52 2017 From: albin.stigo@REDACTED (=?UTF-8?B?QWxiaW4gU3RpZ8O2?=) Date: Mon, 10 Jul 2017 20:11:52 +0200 Subject: [erlang-questions] Erlang in healthcare or medical devices? In-Reply-To: <29a5c76a136453fec2a9cadec08300eb@mykolab.com> References: <29a5c76a136453fec2a9cadec08300eb@mykolab.com> Message-ID: Thank you! Very interesting! --Albin On Sun, Jul 9, 2017 at 11:03 PM, Aaron Seigo wrote: > On 8.7.2017 19:07, Albin Stig? wrote: >> >> What I haven't found so far is medical hardware using Erlang internally... > > > I don't know of any myself, but this may be a decent place to start looking > for your own projects should you begin to dig in: > > http://nerves-project.org/ > > It uses Elixir, but that means the BEAM and Erlang are right there as well. > It seems to have quite a head of steam on it at the moment, and is certainly > worth a look! > > Would be great to see the BEAM on medical devices .. it's about time, > really! > > -- > Aaron Seigo > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From t@REDACTED Mon Jul 10 20:15:03 2017 From: t@REDACTED (Tristan Sloughter) Date: Mon, 10 Jul 2017 11:15:03 -0700 Subject: [erlang-questions] VM with 32MB RAM In-Reply-To: References: <14B139DB-9EF9-4F64-A668-D29030D274A0@gmail.com> Message-ID: <1499710503.3941224.1036320888.2865BE15@webmail.messagingengine.com> > For specialist systems, you could create cut down versions of your applications to only include the modules you are actually using. You are likely to need all of kernel, but beyond that there is scope for minimization ? Right, you can use `exclude_modules` in the relx config to achieve this. As for why it defaults to embedded, this is simply because in a release you've built for your project it is expected you have included only what is needed. Interactive is important for say running the shell during development because you don't want to load the entirety of OTP everytime you pull up `erl`. When that isn't an issue why push load time to when the code is actually called in production instead of getting it done up front. Tristan -------------- next part -------------- An HTML attachment was scrubbed... URL: From albin.stigo@REDACTED Mon Jul 10 20:24:24 2017 From: albin.stigo@REDACTED (=?UTF-8?B?QWxiaW4gU3RpZ8O2?=) Date: Mon, 10 Jul 2017 20:24:24 +0200 Subject: [erlang-questions] Erlang in healthcare or medical devices? In-Reply-To: References: <29a5c76a136453fec2a9cadec08300eb@mykolab.com> Message-ID: Also found this https://www.grisp.org/ Looks very promising! --Albin On Mon, Jul 10, 2017 at 8:11 PM, Albin Stig? wrote: > Thank you! Very interesting! > > --Albin > > On Sun, Jul 9, 2017 at 11:03 PM, Aaron Seigo wrote: >> On 8.7.2017 19:07, Albin Stig? wrote: >>> >>> What I haven't found so far is medical hardware using Erlang internally... >> >> >> I don't know of any myself, but this may be a decent place to start looking >> for your own projects should you begin to dig in: >> >> http://nerves-project.org/ >> >> It uses Elixir, but that means the BEAM and Erlang are right there as well. >> It seems to have quite a head of steam on it at the moment, and is certainly >> worth a look! >> >> Would be great to see the BEAM on medical devices .. it's about time, >> really! >> >> -- >> Aaron Seigo >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From dmkolesnikov@REDACTED Mon Jul 10 20:24:29 2017 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Mon, 10 Jul 2017 21:24:29 +0300 Subject: [erlang-questions] VM with 32MB RAM In-Reply-To: <1499710503.3941224.1036320888.2865BE15@webmail.messagingengine.com> References: <14B139DB-9EF9-4F64-A668-D29030D274A0@gmail.com> <1499710503.3941224.1036320888.2865BE15@webmail.messagingengine.com> Message-ID: <6D951D30-108E-4FF4-9058-0708C9799856@gmail.com> > On 10 Jul 2017, at 21.15, Tristan Sloughter wrote: > > As for why it defaults to embedded, this is simply because in a release you've built for your project it is expected you have included only what is needed. How does it make a decisions what is needed? As far I re-call, it is made at high level only. If you app uses application A that use B and C then all apps are included into release and their code is loaded into memory even if feature of A that uses C is not ever called from my application, right? or it appliance heuristic and pick only the modules that definitely used by the application (in this case C will not be ever included into release)? - Dmitry -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Mon Jul 10 20:31:24 2017 From: t@REDACTED (Tristan Sloughter) Date: Mon, 10 Jul 2017 11:31:24 -0700 Subject: [erlang-questions] VM with 32MB RAM In-Reply-To: <6D951D30-108E-4FF4-9058-0708C9799856@gmail.com> References: <14B139DB-9EF9-4F64-A668-D29030D274A0@gmail.com> <1499710503.3941224.1036320888.2865BE15@webmail.messagingengine.com> <6D951D30-108E-4FF4-9058-0708C9799856@gmail.com> Message-ID: <1499711484.3944294.1036339424.10D2A9DB@webmail.messagingengine.com> It is done by the applications list in the .app files. It isn't possible to check that C will never be used in your example. xref can probably used to find some cases. But it is up to the user to add to the relx config `{exclude_apps, [C]}` which tells relx to not only not include C but also remove C from any .app file that had it listed. -- Tristan Sloughter "I am not a crackpot" - Abe Simpson t@REDACTED On Mon, Jul 10, 2017, at 11:24 AM, Dmitry Kolesnikov wrote: > >> On 10 Jul 2017, at 21.15, Tristan Sloughter wrote:>> >> As for why it defaults to embedded, this is simply because in a release you've built for your project it is expected you have included only what is needed. > > How does it make a decisions what is needed? As far I re-call, it is made at high level only. If you app uses application A that use B and C then all apps are included into release and their code is loaded into memory even if feature of A that uses C is not ever called from my application, right? or it appliance heuristic and pick only the modules that definitely used by the application (in this case C will not be ever included into release)? > > - Dmitry > -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Mon Jul 10 20:41:40 2017 From: t@REDACTED (Tristan Sloughter) Date: Mon, 10 Jul 2017 11:41:40 -0700 Subject: [erlang-questions] VM with 32MB RAM In-Reply-To: <1499711484.3944294.1036339424.10D2A9DB@webmail.messagingengine.com> References: <14B139DB-9EF9-4F64-A668-D29030D274A0@gmail.com> <1499710503.3941224.1036320888.2865BE15@webmail.messagingengine.com> <6D951D30-108E-4FF4-9058-0708C9799856@gmail.com> <1499711484.3944294.1036339424.10D2A9DB@webmail.messagingengine.com> Message-ID: <1499712100.3946676.1036356424.0B9E3F94@webmail.messagingengine.com> A little fish told me another benefit of embedded mode just now. In embedded mode there is no code server lookup for an undefined function. So a system that makes use of catching an undef will not be happy once under load and in interactive mode. -- Tristan Sloughter "I am not a crackpot" - Abe Simpson t@REDACTED On Mon, Jul 10, 2017, at 11:31 AM, Tristan Sloughter wrote: > It is done by the applications list in the .app files. It isn't possible to check that C will never be used in your example. xref can probably used to find some cases. But it is up to the user to add to the relx config `{exclude_apps, [C]}` which tells relx to not only not include C but also remove C from any .app file that had it listed.> > -- > Tristan Sloughter > "I am not a crackpot" - Abe Simpson > t@REDACTED > > > On Mon, Jul 10, 2017, at 11:24 AM, Dmitry Kolesnikov wrote: >> >>> On 10 Jul 2017, at 21.15, Tristan Sloughter wrote:>>> >>> As for why it defaults to embedded, this is simply because in a release you've built for your project it is expected you have included only what is needed. >> >> How does it make a decisions what is needed? As far I re-call, it is made at high level only. If you app uses application A that use B and C then all apps are included into release and their code is loaded into memory even if feature of A that uses C is not ever called from my application, right? or it appliance heuristic and pick only the modules that definitely used by the application (in this case C will not be ever included into release)? >> >> - Dmitry >> > > _________________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From steven.charles.davis@REDACTED Tue Jul 11 01:07:39 2017 From: steven.charles.davis@REDACTED (Steve Davis) Date: Mon, 10 Jul 2017 18:07:39 -0500 Subject: [erlang-questions] wxErlang question 4 Message-ID: <6542A333-D3C1-46C8-8DCA-481116954236@gmail.com> Sizers are crazy. A while back I had a decent go at making a hand-written version of wx interfacing directly to the erlang driver and trying to make it sensible as an API like GS. I think it should still work. The following code was the result of a lot of reading the WxWidgets C++ API docs and translating into what I felt was sensible to get to a single interface module that resembled GS (i.e the module gx.erl). https://github.com/komone/gx/blob/master/src/ui/gx_ui_sizer.erl https://github.com/komone/gx/blob/master/src/ui/gx_ui_control.erl https://github.com/komone/gx/blob/master/src/ui/gx_ui_button.erl -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Tue Jul 11 03:17:13 2017 From: zxq9@REDACTED (zxq9) Date: Tue, 11 Jul 2017 10:17:13 +0900 Subject: [erlang-questions] wxErlang question 6 - Image display In-Reply-To: References: Message-ID: <2204355.WlGmo74t7l@changa> On 2017?07?08? ??? 15:14:05 Joe Armstrong wrote: > Images > > wxWidgets is breaking the principle of least astonishment Indeed. Most of all with regard to semantics. "Window", "frame", "image", "bitmap" and so on all mean slightly different things than we expect. The semantic hurdles were my greatest annoyance with WX, and still are. > Image = wxImage:new("image.jpg", []), > wxSizer:add(Vbox, Image, ...) > > But oh dear - this doesn't work. > > I Googled a bit - and it appears I have to mess with paint events and > graphics contexts and so on. > > But why? - why break the principle of least atonishment. > > Is it possible to dispay an Image in a Panel *without* handling graphics context > and paint events? I remember encountering this problem... and I placed the solution into a library (which I've been doing gradually with quite a few things to make them more Erlangish). Looking it up, I see that I had been using wxBitmap to display jpegs and pngs. The relevant code: https://github.com/zxq9/zxWidgets/blob/master/src/zxw.erl#L101-L114 That function is a shortcut for displaying a PNG image button, but I believe the basic bits worked for displaying an image inside a sizer also. Until now I've only dabbled with abstracting away a few annoyances into my little widget wrapper lib. Within about a month or so I'll be back working on it quite deliberately. I'll let you know how it goes. My goal is to prevent myself from having to constantly write pages of extremely long functions just to get a few generic things on the screen (like grids of input fields, basic data displays where we know basically an X-columns wide set of information like [{Label, Data}] but don't want it to look like a Calc spreadsheet, etc.). -Craig From david@REDACTED Mon Jul 10 21:11:24 2017 From: david@REDACTED (David de Boer) Date: Mon, 10 Jul 2017 21:11:24 +0200 Subject: [erlang-questions] basho/sidejob continued Message-ID: <0F560FE8-8450-469D-803A-6E15F2FA7D63@ddeboer.nl> Hi folks, For your information: with the demise of Basho, we decided to fork basho/sidejob to be able to keep maintaining and updating it. Head to https://github.com/erlangpack/sidejob for an updated version. Also available on Hex.pm. If any of the original maintainers on basho/sidejob is reading this: please let me know. I?d very much like to move the basho/sidejob repository in order to prevent confusion on where to head for issues and updates. Cheers, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From scohen@REDACTED Mon Jul 10 21:14:07 2017 From: scohen@REDACTED (Steve Cohen) Date: Mon, 10 Jul 2017 12:14:07 -0700 Subject: [erlang-questions] Erlang VM hanging on node death Message-ID: Hi all, We have 12 nodes in a our guilds cluster, and on each, 500,000 processes. We have another cluster that has 15 nodes with roughly four million processes on it, called sessions. Both clusters are in the same erlang distribution since our guilds monitor sessions and vice-versa. Now, when one of our guild servers dies, as expected it generates a large number of DOWN messages to the sessions cluster. These messages bog down the sessions servers (obviously) while they process them, but when they're done processing, distribution appears to be completely broken. By broken, I mean that the nodes are disconnected from one another, they're not exchanging messages, CPU usage was 0 and we couldn't even launch the remote console. I can't imagine this is expected behavior, and was wondering if someone can shed some light on it. We're open to the idea that we're doing something very, very wrong. Thanks in advance for the help -- Steve Cohen -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Tue Jul 11 09:48:36 2017 From: erlang@REDACTED (Joe Armstrong) Date: Tue, 11 Jul 2017 09:48:36 +0200 Subject: [erlang-questions] wxErlang question 4 In-Reply-To: <6542A333-D3C1-46C8-8DCA-481116954236@gmail.com> References: <6542A333-D3C1-46C8-8DCA-481116954236@gmail.com> Message-ID: Wow - lot's of code for me to stare at - thanks A couple of questions: 1) I downloaded the gx project and saw that there had been no commits since Jul 13 2014 - is this totally dead? 2) How do I run your gx code? - what's a top level command to create a window??? Cheers /Joe On Tue, Jul 11, 2017 at 1:07 AM, Steve Davis wrote: > Sizers are crazy. A while back I had a decent go at making a hand-written > version of wx interfacing directly to the erlang driver and trying to make > it sensible as an API like GS. I think it should still work. > > The following code was the result of a lot of reading the WxWidgets C++ API > docs and translating into what I felt was sensible to get to a single > interface module that resembled GS (i.e the module gx.erl). > > https://github.com/komone/gx/blob/master/src/ui/gx_ui_sizer.erl > > https://github.com/komone/gx/blob/master/src/ui/gx_ui_control.erl > > https://github.com/komone/gx/blob/master/src/ui/gx_ui_button.erl > > From erlang@REDACTED Tue Jul 11 10:28:40 2017 From: erlang@REDACTED (Joe Armstrong) Date: Tue, 11 Jul 2017 10:28:40 +0200 Subject: [erlang-questions] wxErlang question 6 - Image display In-Reply-To: References: Message-ID: To answer my own question - this works but the code has a nasty smell Is this really how do do things? must I setup a paint handler and do it this way? Is there a better way?? -module(image_png). -export([start/0]). -include_lib("wx/include/wx.hrl"). start() -> W = wx:new(), Frame = wxFrame:new(W, -1, "PNG image"), Panel = wxPanel:new(Frame, [{size,{400,600}}]), Vbox = wxBoxSizer:new(?wxVERTICAL), wxSizer:add(Vbox, Panel, [{proportion, 1}, {flag, ?wxEXPAND}]), Image = wxBitmap:new("frame1.png", [{type, ?wxBITMAP_TYPE_PNG}]), F = fun(I, _) -> redraw(Image,I) end, wxPanel:connect(Panel, paint, [{callback,F}]), wxFrame:show(Frame). redraw(Image, #wx{obj=Panel}) -> DC = wxPaintDC:new(Panel), wxDC:drawBitmap(DC,Image,{0,0}). /Joe On Sat, Jul 8, 2017 at 3:14 PM, Joe Armstrong wrote: > Images > > wxWidgets is breaking the principle of least astonishment > > I've been making a load of widgets and adding them to a Vbox > which arranges them in a vertical stack. > > To make a button > > Button = wxButton:new(Panel, Id, [{label,"My New Button"}]), > wxSizer:add(Vbox, Button, ...) > > To make a text editor > > Button = wxTextCtrl:new(Panel, Id, ...), > wxSizer:add(Vbox, Editor, ...) > > To make a combo box > > Combo = wxComboBox:new(Panel, Id, ..), > wxSizer:add(Vbox, Combo, ...) > > and so on. > > At this point I began thinking "I'm beginng to understand this stuff" but ... > > I thought I'd add an image, so I tried this: > > Image = wxImage:new("image.jpg", []), > wxSizer:add(Vbox, Image, ...) > > But oh dear - this doesn't work. > > I Googled a bit - and it appears I have to mess with paint events and > graphics contexts and so on. > > But why? - why break the principle of least atonishment. > > Is it possible to dispay an Image in a Panel *without* handling graphics context > and paint events? From erlang@REDACTED Tue Jul 11 10:46:28 2017 From: erlang@REDACTED (Joe Armstrong) Date: Tue, 11 Jul 2017 10:46:28 +0200 Subject: [erlang-questions] wxErlang question 6 - Image display In-Reply-To: <2204355.WlGmo74t7l@changa> References: <2204355.WlGmo74t7l@changa> Message-ID: On Tue, Jul 11, 2017 at 3:17 AM, zxq9 wrote: > On 2017?07?08? ??? 15:14:05 Joe Armstrong wrote: >> Images >> >> wxWidgets is breaking the principle of least astonishment > > Indeed. Most of all with regard to semantics. "Window", "frame", "image", "bitmap" and so on all mean slightly different things than we expect. The semantic hurdles were my greatest annoyance with WX, and still are. > >> Image = wxImage:new("image.jpg", []), >> wxSizer:add(Vbox, Image, ...) >> >> But oh dear - this doesn't work. >> >> I Googled a bit - and it appears I have to mess with paint events and >> graphics contexts and so on. >> >> But why? - why break the principle of least atonishment. >> >> Is it possible to dispay an Image in a Panel *without* handling graphics context >> and paint events? > > I remember encountering this problem... and I placed the solution into a library (which I've been doing gradually with quite a few things to make them more Erlangish). Looking it up, I see that I had been using wxBitmap to display jpegs and pngs. > > The relevant code: > > https://github.com/zxq9/zxWidgets/blob/master/src/zxw.erl#L101-L114 > > That function is a shortcut for displaying a PNG image button, but I believe the basic bits worked for displaying an image inside a sizer also. I tried to put the bit map in a sizer without any joy - it might be possible > > Until now I've only dabbled with abstracting away a few annoyances into my little widget wrapper lib. Within about a month or so I'll be back working on it quite deliberately. I'll let you know how it goes. My goal is to prevent myself from having to constantly write pages of extremely long functions just to get a few generic things on the screen (like grids of input fields, basic data displays where we know basically an X-columns wide set of information like [{Label, Data}] but don't want it to look like a Calc spreadsheet, etc. Brilliant - I'm convinced this is the right way to go. I recently ran into a problem - I wanted a text editor with a given width and height and border If you put this in a Vbox and set wxEXPAND and if the origional size of the editor is bigger than the frame window then the padding is ignored. The work around is to make the initial width rather small in the knowledge the the vbox entries will ignored when it is expanded - so the border argument to the sizer depends heavily upon context. Instead of saying wxSpacer:add(X,Y,[{border,10}, ..]) I want a *functional* interface Panel1 = add_padding(Panel) that *always* works Hopefully we can discover a smallish set of combinators that hides the horrendous mess of callbacks. Cheers /Joe /Joe > > -Craig > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From steven.charles.davis@REDACTED Tue Jul 11 13:22:58 2017 From: steven.charles.davis@REDACTED (Steve Davis) Date: Tue, 11 Jul 2017 06:22:58 -0500 Subject: [erlang-questions] wxErlang question 4 In-Reply-To: References: <6542A333-D3C1-46C8-8DCA-481116954236@gmail.com> Message-ID: <262C7097-5967-4E82-8F25-E52F24A40019@gmail.com> 1) One of those projects that I haven?t had time for. If there was interest, it may rekindle my interest in moving it along. Looking back, with the second prototype I diverged too far from the GS way of doing this as I got focused on XML definitions and so the interactive REPL part suffered. it?s really code in mid-flight. 2) However, the code still seems to work under R20 - See console session below: Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] Eshell V9.0 (abort with ^G) 1> gx:start(). [<0.63.0> gx_driver:150] "/opt/local/lib/erlang/lib/wx-1.8.1/priv" [<0.63.0> gx_driver:124] info_got_wx_consts [<0.63.0> gx_driver:134] {handle_info, {wxe_driver,open_file,"/Users/stevedavis"}} {ok,<0.62.0>} 2> rr(gx). [aui,bitmapbutton,box,button,calendar,checkbox,checklist, choice,combo,control,date,dialog,editor,evh,filetree,font, frame,g,grid,gs,gs_font,gui,gx,gx_cache,gx_ui,gx_wx,image, input,line|...] 3> F = #frame{id=window, size={400,200}}. #frame{id = window,ref = undefined,label = undefined, pos = {-1,-1}, size = {400,200}, callbacks = [],icon = undefined,title = <<"Untitled">>, show = true,virtual = false,content = []} 4> gx:create(F). [#gx_ui{id = window, ref = #wx_ref{ref = 37,type = wxFrame,state = []}, parent = #wx_ref{ref = 0,type = wx,state = []}, module = gx_ui_frame}] 5> gx:names(). [window] 6> gx:config(window, size, {800, 400}). [<0.60.0> gx_ui:59] {{g,<0.62.0>,#Port<0.3025>,undefined,<0.64.0>,gx}, window, [{size,{800,400}}]} [ok] 7> gx:ide(). [<0.95.0> gx_ui:59] {{g,<0.93.0>,#Port<0.3158>,undefined,<0.94.0>,ide}, log, [{append,<<"$ {init,{gx,ide,{wx_ref,0,wx,[]},gx,start,[],[]},[{resources,undefined}]}\n">>}]} {ok,<0.93.0>} > On Jul 11, 2017, at 2:48 AM, Joe Armstrong wrote: > > Wow - lot's of code for me to stare at - thanks > > A couple of questions: > > 1) I downloaded the gx project and saw that there had been no > commits since Jul 13 2014 - is this totally dead? > > 2) How do I run your gx code? - what's a top level command to create a window??? > > Cheers > > /Joe > > > On Tue, Jul 11, 2017 at 1:07 AM, Steve Davis > wrote: >> Sizers are crazy. A while back I had a decent go at making a hand-written >> version of wx interfacing directly to the erlang driver and trying to make >> it sensible as an API like GS. I think it should still work. >> >> The following code was the result of a lot of reading the WxWidgets C++ API >> docs and translating into what I felt was sensible to get to a single >> interface module that resembled GS (i.e the module gx.erl). >> >> https://github.com/komone/gx/blob/master/src/ui/gx_ui_sizer.erl >> >> https://github.com/komone/gx/blob/master/src/ui/gx_ui_control.erl >> >> https://github.com/komone/gx/blob/master/src/ui/gx_ui_button.erl >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Tue Jul 11 16:39:13 2017 From: erlang@REDACTED (Joe Armstrong) Date: Tue, 11 Jul 2017 16:39:13 +0200 Subject: [erlang-questions] wxErlang question 4 In-Reply-To: <262C7097-5967-4E82-8F25-E52F24A40019@gmail.com> References: <6542A333-D3C1-46C8-8DCA-481116954236@gmail.com> <262C7097-5967-4E82-8F25-E52F24A40019@gmail.com> Message-ID: It didn't work for me - how did you launch this? I did erl -pa ebin in the root directory (gx-master) gx:config works and I see a window but gx:idx() crashes with a badmatch in line 37 of gx_ui_filetree.erl the line saying directory = path:type(Path), I think this is returning undefined - Do I have to set some environment variables or something? ./Joe On Tue, Jul 11, 2017 at 1:22 PM, Steve Davis wrote: > 1) One of those projects that I haven?t had time for. If there was interest, > it may rekindle my interest in moving it along. Looking back, with the > second prototype I diverged too far from the GS way of doing this as I got > focused on XML definitions and so the interactive REPL part suffered. it?s > really code in mid-flight. > > 2) However, the code still seems to work under R20 - See console session > below: > > Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] > [async-threads:10] [hipe] [kernel-poll:false] > > Eshell V9.0 (abort with ^G) > 1> gx:start(). > [<0.63.0> gx_driver:150] "/opt/local/lib/erlang/lib/wx-1.8.1/priv" > [<0.63.0> gx_driver:124] info_got_wx_consts > [<0.63.0> gx_driver:134] {handle_info, > {wxe_driver,open_file,"/Users/stevedavis"}} > {ok,<0.62.0>} > 2> rr(gx). > [aui,bitmapbutton,box,button,calendar,checkbox,checklist, > choice,combo,control,date,dialog,editor,evh,filetree,font, > frame,g,grid,gs,gs_font,gui,gx,gx_cache,gx_ui,gx_wx,image, > input,line|...] > 3> F = #frame{id=window, size={400,200}}. > #frame{id = window,ref = undefined,label = undefined, > pos = {-1,-1}, > size = {400,200}, > callbacks = [],icon = undefined,title = <<"Untitled">>, > show = true,virtual = false,content = []} > 4> gx:create(F). > [#gx_ui{id = window, > ref = #wx_ref{ref = 37,type = wxFrame,state = []}, > parent = #wx_ref{ref = 0,type = wx,state = []}, > module = gx_ui_frame}] > 5> gx:names(). > [window] > 6> gx:config(window, size, {800, 400}). > [<0.60.0> gx_ui:59] {{g,<0.62.0>,#Port<0.3025>,undefined,<0.64.0>,gx}, > window, > [{size,{800,400}}]} > [ok] > 7> gx:ide(). > [<0.95.0> gx_ui:59] {{g,<0.93.0>,#Port<0.3158>,undefined,<0.94.0>,ide}, > log, > [{append,<<"$ > {init,{gx,ide,{wx_ref,0,wx,[]},gx,start,[],[]},[{resources,undefined}]}\n">>}]} > {ok,<0.93.0>} > > > > > On Jul 11, 2017, at 2:48 AM, Joe Armstrong wrote: > > Wow - lot's of code for me to stare at - thanks > > A couple of questions: > > 1) I downloaded the gx project and saw that there had been no > commits since Jul 13 2014 - is this totally dead? > > 2) How do I run your gx code? - what's a top level command to create a > window??? > > Cheers > > /Joe > > > On Tue, Jul 11, 2017 at 1:07 AM, Steve Davis > wrote: > > Sizers are crazy. A while back I had a decent go at making a hand-written > version of wx interfacing directly to the erlang driver and trying to make > it sensible as an API like GS. I think it should still work. > > The following code was the result of a lot of reading the WxWidgets C++ API > docs and translating into what I felt was sensible to get to a single > interface module that resembled GS (i.e the module gx.erl). > > https://github.com/komone/gx/blob/master/src/ui/gx_ui_sizer.erl > > https://github.com/komone/gx/blob/master/src/ui/gx_ui_control.erl > > https://github.com/komone/gx/blob/master/src/ui/gx_ui_button.erl > > > From steven.charles.davis@REDACTED Tue Jul 11 19:57:00 2017 From: steven.charles.davis@REDACTED (Steve Davis) Date: Tue, 11 Jul 2017 12:57:00 -0500 Subject: [erlang-questions] wxErlang question 4 In-Reply-To: References: <6542A333-D3C1-46C8-8DCA-481116954236@gmail.com> <262C7097-5967-4E82-8F25-E52F24A40019@gmail.com> Message-ID: <958DCB52-C623-4770-B9C3-3564BD1D7A96@gmail.com> You shouldn?t have to, no. I just cloned a new copy from github (and cleared my ERL_LIBS to make sure I wasn?t pulling in anything else) and it all seemed to work for me. Do you have the stacktrace? > On Jul 11, 2017, at 9:39 AM, Joe Armstrong wrote: > > It didn't work for me - how did you launch this? > > I did erl -pa ebin in the root directory (gx-master) > gx:config works and I see a window > > but gx:idx() crashes with a badmatch > in line 37 of gx_ui_filetree.erl the line saying > > directory = path:type(Path), > > I think this is returning undefined - > > Do I have to set some environment variables or something? > > ./Joe > > > > On Tue, Jul 11, 2017 at 1:22 PM, Steve Davis > wrote: >> 1) One of those projects that I haven?t had time for. If there was interest, >> it may rekindle my interest in moving it along. Looking back, with the >> second prototype I diverged too far from the GS way of doing this as I got >> focused on XML definitions and so the interactive REPL part suffered. it?s >> really code in mid-flight. >> >> 2) However, the code still seems to work under R20 - See console session >> below: >> >> Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] >> [async-threads:10] [hipe] [kernel-poll:false] >> >> Eshell V9.0 (abort with ^G) >> 1> gx:start(). >> [<0.63.0> gx_driver:150] "/opt/local/lib/erlang/lib/wx-1.8.1/priv" >> [<0.63.0> gx_driver:124] info_got_wx_consts >> [<0.63.0> gx_driver:134] {handle_info, >> {wxe_driver,open_file,"/Users/stevedavis"}} >> {ok,<0.62.0>} >> 2> rr(gx). >> [aui,bitmapbutton,box,button,calendar,checkbox,checklist, >> choice,combo,control,date,dialog,editor,evh,filetree,font, >> frame,g,grid,gs,gs_font,gui,gx,gx_cache,gx_ui,gx_wx,image, >> input,line|...] >> 3> F = #frame{id=window, size={400,200}}. >> #frame{id = window,ref = undefined,label = undefined, >> pos = {-1,-1}, >> size = {400,200}, >> callbacks = [],icon = undefined,title = <<"Untitled">>, >> show = true,virtual = false,content = []} >> 4> gx:create(F). >> [#gx_ui{id = window, >> ref = #wx_ref{ref = 37,type = wxFrame,state = []}, >> parent = #wx_ref{ref = 0,type = wx,state = []}, >> module = gx_ui_frame}] >> 5> gx:names(). >> [window] >> 6> gx:config(window, size, {800, 400}). >> [<0.60.0> gx_ui:59] {{g,<0.62.0>,#Port<0.3025>,undefined,<0.64.0>,gx}, >> window, >> [{size,{800,400}}]} >> [ok] >> 7> gx:ide(). >> [<0.95.0> gx_ui:59] {{g,<0.93.0>,#Port<0.3158>,undefined,<0.94.0>,ide}, >> log, >> [{append,<<"$ >> {init,{gx,ide,{wx_ref,0,wx,[]},gx,start,[],[]},[{resources,undefined}]}\n">>}]} >> {ok,<0.93.0>} >> >> >> >> >> On Jul 11, 2017, at 2:48 AM, Joe Armstrong wrote: >> >> Wow - lot's of code for me to stare at - thanks >> >> A couple of questions: >> >> 1) I downloaded the gx project and saw that there had been no >> commits since Jul 13 2014 - is this totally dead? >> >> 2) How do I run your gx code? - what's a top level command to create a >> window??? >> >> Cheers >> >> /Joe >> >> >> On Tue, Jul 11, 2017 at 1:07 AM, Steve Davis >> wrote: >> >> Sizers are crazy. A while back I had a decent go at making a hand-written >> version of wx interfacing directly to the erlang driver and trying to make >> it sensible as an API like GS. I think it should still work. >> >> The following code was the result of a lot of reading the WxWidgets C++ API >> docs and translating into what I felt was sensible to get to a single >> interface module that resembled GS (i.e the module gx.erl). >> >> https://github.com/komone/gx/blob/master/src/ui/gx_ui_sizer.erl >> >> https://github.com/komone/gx/blob/master/src/ui/gx_ui_control.erl >> >> https://github.com/komone/gx/blob/master/src/ui/gx_ui_button.erl >> >> >> From steven.charles.davis@REDACTED Tue Jul 11 20:12:18 2017 From: steven.charles.davis@REDACTED (Steve Davis) Date: Tue, 11 Jul 2017 13:12:18 -0500 Subject: [erlang-questions] wxErlang question 4 In-Reply-To: <958DCB52-C623-4770-B9C3-3564BD1D7A96@gmail.com> References: <6542A333-D3C1-46C8-8DCA-481116954236@gmail.com> <262C7097-5967-4E82-8F25-E52F24A40019@gmail.com> <958DCB52-C623-4770-B9C3-3564BD1D7A96@gmail.com> Message-ID: I see why. You can either: 1) rename the parent directory to ?gx? rather than ?gx-master? 2) or edit the path attribute in priv/ide.xml line 41 >> [<0.63.0> gx_driver:124] info_got_wx_consts >>> [<0.63.0> gx_driver:134] {handle_info, >>> {wxe_driver,open_file,"/Users/stevedavis"}} >>> {ok,<0.62.0>} >>> 2> rr(gx). >>> [aui,bitmapbutton,box,button,calendar,checkbox,checklist, >>> choice,combo,control,date,dialog,editor,evh,filetree,font, >>> frame,g,grid,gs,gs_font,gui,gx,gx_cache,gx_ui,gx_wx,image, >>> input,line|...] >>> 3> F = #frame{id=window, size={400,200}}. >>> #frame{id = window,ref = undefined,label = undefined, >>> pos = {-1,-1}, >>> size = {400,200}, >>> callbacks = [],icon = undefined,title = <<"Untitled">>, >>> show = true,virtual = false,content = []} >>> 4> gx:create(F). >>> [#gx_ui{id = window, >>> ref = #wx_ref{ref = 37,type = wxFrame,state = []}, >>> parent = #wx_ref{ref = 0,type = wx,state = []}, >>> module = gx_ui_frame}] >>> 5> gx:names(). >>> [window] >>> 6> gx:config(window, size, {800, 400}). >>> [<0.60.0> gx_ui:59] {{g,<0.62.0>,#Port<0.3025>,undefined,<0.64.0>,gx}, >>> window, >>> [{size,{800,400}}]} >>> [ok] >>> 7> gx:ide(). >>> [<0.95.0> gx_ui:59] {{g,<0.93.0>,#Port<0.3158>,undefined,<0.94.0>,ide}, >>> log, >>> [{append,<<"$ >>> {init,{gx,ide,{wx_ref,0,wx,[]},gx,start,[],[]},[{resources,undefined}]}\n">>}]} >>> {ok,<0.93.0>} >>> >>> >>> >>> >>> On Jul 11, 2017, at 2:48 AM, Joe Armstrong wrote: >>> >>> Wow - lot's of code for me to stare at - thanks >>> >>> A couple of questions: >>> >>> 1) I downloaded the gx project and saw that there had been no >>> commits since Jul 13 2014 - is this totally dead? >>> >>> 2) How do I run your gx code? - what's a top level command to create a >>> window??? >>> >>> Cheers >>> >>> /Joe >>> >>> >>> On Tue, Jul 11, 2017 at 1:07 AM, Steve Davis >>> wrote: >>> >>> Sizers are crazy. A while back I had a decent go at making a hand-written >>> version of wx interfacing directly to the erlang driver and trying to make >>> it sensible as an API like GS. I think it should still work. >>> >>> The following code was the result of a lot of reading the WxWidgets C++ API >>> docs and translating into what I felt was sensible to get to a single >>> interface module that resembled GS (i.e the module gx.erl). >>> >>> https://github.com/komone/gx/blob/master/src/ui/gx_ui_sizer.erl >>> >>> https://github.com/komone/gx/blob/master/src/ui/gx_ui_control.erl >>> >>> https://github.com/komone/gx/blob/master/src/ui/gx_ui_button.erl >>> >>> >>> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Tue Jul 11 20:15:26 2017 From: erlang@REDACTED (Joe Armstrong) Date: Tue, 11 Jul 2017 20:15:26 +0200 Subject: [erlang-questions] wxErlang question 4 In-Reply-To: <958DCB52-C623-4770-B9C3-3564BD1D7A96@gmail.com> References: <6542A333-D3C1-46C8-8DCA-481116954236@gmail.com> <262C7097-5967-4E82-8F25-E52F24A40019@gmail.com> <958DCB52-C623-4770-B9C3-3564BD1D7A96@gmail.com> Message-ID: Stack trace follows: test.erl -module(test). -compile(export_all). -include("include/gx.hrl"). test() -> gx:start(), %% rr(gx). F = #frame{id=window, size={400,200}}, gx:create(F), gx:names(), gx:config(window, size, {800, 400}), gx:ide(). 1> test:test(). [<0.67.0> gx_driver] "/usr/local/Cellar/erlang/20.0/lib/erlang/lib/wx-1.8.1/priv" [<0.67.0> gx_driver] {handle_info,{wxe_driver,open_file,"enabled"}} [<0.66.0> gx_srv] {g,<0.66.0>,#Port<0.765>,undefined,<0.68.0>,gx} [<0.70.0> gx_srv] {g,<0.70.0>,#Port<0.779>,undefined,<0.71.0>,ide} ** exception exit: {{badmatch,undefined}, [{gx_ui_filetree,create,3, [{file,"src/ui/gx_ui_filetree.erl"}, {line,37}]}, {gx_ui,create,3,[{file,"src/gx_ui.erl"},{line,44}]}, {gx_ui,'-create/3-lc$^0/1-0-',3, [{file,"src/gx_ui.erl"},{line,39}]}, {gx_ui_panel,create,3, [{file,"src/ui/gx_ui_panel.erl"},{line,46}]}, {gx_ui,create,3,[{file,"src/gx_ui.erl"},{line,44}]}, {gx_ui_tab,create,3, [{file,"src/ui/gx_ui_tab.erl"},{line,35}]}, {gx_ui,create,3,[{file,"src/gx_ui.erl"},{line,44}]}, {gx_ui,'-create/3-lc$^0/1-0-',3, [{file,"src/gx_ui.erl"},{line,39}]}]} in function gx_wx:batch/2 (src/gx_wx.erl, line 39) in call from gx_srv:start/1 (src/gx_srv.erl, line 33) /Joe On Tue, Jul 11, 2017 at 7:57 PM, Steve Davis wrote: > You shouldn?t have to, no. I just cloned a new copy from github (and cleared my ERL_LIBS to make sure I wasn?t pulling in anything else) and it all seemed to work for me. > > Do you have the stacktrace? > > >> On Jul 11, 2017, at 9:39 AM, Joe Armstrong wrote: >> >> It didn't work for me - how did you launch this? >> >> I did erl -pa ebin in the root directory (gx-master) >> gx:config works and I see a window >> >> but gx:idx() crashes with a badmatch >> in line 37 of gx_ui_filetree.erl the line saying >> >> directory = path:type(Path), >> >> I think this is returning undefined - >> >> Do I have to set some environment variables or something? >> >> ./Joe >> >> >> >> On Tue, Jul 11, 2017 at 1:22 PM, Steve Davis >> wrote: >>> 1) One of those projects that I haven?t had time for. If there was interest, >>> it may rekindle my interest in moving it along. Looking back, with the >>> second prototype I diverged too far from the GS way of doing this as I got >>> focused on XML definitions and so the interactive REPL part suffered. it?s >>> really code in mid-flight. >>> >>> 2) However, the code still seems to work under R20 - See console session >>> below: >>> >>> Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] >>> [async-threads:10] [hipe] [kernel-poll:false] >>> >>> Eshell V9.0 (abort with ^G) >>> 1> gx:start(). >>> [<0.63.0> gx_driver:150] "/opt/local/lib/erlang/lib/wx-1.8.1/priv" >>> [<0.63.0> gx_driver:124] info_got_wx_consts >>> [<0.63.0> gx_driver:134] {handle_info, >>> {wxe_driver,open_file,"/Users/stevedavis"}} >>> {ok,<0.62.0>} >>> 2> rr(gx). >>> [aui,bitmapbutton,box,button,calendar,checkbox,checklist, >>> choice,combo,control,date,dialog,editor,evh,filetree,font, >>> frame,g,grid,gs,gs_font,gui,gx,gx_cache,gx_ui,gx_wx,image, >>> input,line|...] >>> 3> F = #frame{id=window, size={400,200}}. >>> #frame{id = window,ref = undefined,label = undefined, >>> pos = {-1,-1}, >>> size = {400,200}, >>> callbacks = [],icon = undefined,title = <<"Untitled">>, >>> show = true,virtual = false,content = []} >>> 4> gx:create(F). >>> [#gx_ui{id = window, >>> ref = #wx_ref{ref = 37,type = wxFrame,state = []}, >>> parent = #wx_ref{ref = 0,type = wx,state = []}, >>> module = gx_ui_frame}] >>> 5> gx:names(). >>> [window] >>> 6> gx:config(window, size, {800, 400}). >>> [<0.60.0> gx_ui:59] {{g,<0.62.0>,#Port<0.3025>,undefined,<0.64.0>,gx}, >>> window, >>> [{size,{800,400}}]} >>> [ok] >>> 7> gx:ide(). >>> [<0.95.0> gx_ui:59] {{g,<0.93.0>,#Port<0.3158>,undefined,<0.94.0>,ide}, >>> log, >>> [{append,<<"$ >>> {init,{gx,ide,{wx_ref,0,wx,[]},gx,start,[],[]},[{resources,undefined}]}\n">>}]} >>> {ok,<0.93.0>} >>> >>> >>> >>> >>> On Jul 11, 2017, at 2:48 AM, Joe Armstrong wrote: >>> >>> Wow - lot's of code for me to stare at - thanks >>> >>> A couple of questions: >>> >>> 1) I downloaded the gx project and saw that there had been no >>> commits since Jul 13 2014 - is this totally dead? >>> >>> 2) How do I run your gx code? - what's a top level command to create a >>> window??? >>> >>> Cheers >>> >>> /Joe >>> >>> >>> On Tue, Jul 11, 2017 at 1:07 AM, Steve Davis >>> wrote: >>> >>> Sizers are crazy. A while back I had a decent go at making a hand-written >>> version of wx interfacing directly to the erlang driver and trying to make >>> it sensible as an API like GS. I think it should still work. >>> >>> The following code was the result of a lot of reading the WxWidgets C++ API >>> docs and translating into what I felt was sensible to get to a single >>> interface module that resembled GS (i.e the module gx.erl). >>> >>> https://github.com/komone/gx/blob/master/src/ui/gx_ui_sizer.erl >>> >>> https://github.com/komone/gx/blob/master/src/ui/gx_ui_control.erl >>> >>> https://github.com/komone/gx/blob/master/src/ui/gx_ui_button.erl >>> >>> >>> > From juanjo@REDACTED Wed Jul 12 05:34:04 2017 From: juanjo@REDACTED (Juan Jose Comellas) Date: Wed, 12 Jul 2017 00:34:04 -0300 Subject: [erlang-questions] Erlang VM hanging on node death In-Reply-To: References: Message-ID: How long does it take for all the DOWN messages to be sent/processed? These messages might not be allowing the net tick messages (see net_ticktime in http://erlang.org/doc/man/kernel_app.html) to be responded in time. If this happens, the node that isn't able to respond before the net_ticktime expires will be assumed to be disconnected. What happens if after processing all the DOWN messages you issue a call to net_kernel:connect_node/1 for each of the nodes that seems to be down? On Mon, Jul 10, 2017 at 4:14 PM, Steve Cohen wrote: > Hi all, > > We have 12 nodes in a our guilds cluster, and on each, 500,000 processes. > We have another cluster that has 15 nodes with roughly four million > processes on it, called sessions. Both clusters are in the same erlang > distribution since our guilds monitor sessions and vice-versa. > > Now, when one of our guild servers dies, as expected it generates a large > number of DOWN messages to the sessions cluster. These messages bog down > the sessions servers (obviously) while they process them, but when they're > done processing, distribution appears to be completely broken. > > By broken, I mean that the nodes are disconnected from one another, > they're not exchanging messages, CPU usage was 0 and we couldn't even > launch the remote console. > > I can't imagine this is expected behavior, and was wondering if someone > can shed some light on it. > We're open to the idea that we're doing something very, very wrong. > > > Thanks in advance for the help > > -- > Steve Cohen > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Wed Jul 12 18:49:51 2017 From: roger@REDACTED (Roger Lipscombe) Date: Wed, 12 Jul 2017 17:49:51 +0100 Subject: [erlang-questions] TLS: Choosing a server certificate based on client's accepted algorithms Message-ID: Apparently, nginx allows you to specify multiple server certificates (e.g. RSA and ECDHE), and it'll choose the appropriate one based on the client's preference. See, for example: https://scotthelme.co.uk/hybrid-rsa-and-ecdsa-certificates-with-nginx/ I find myself needing something similar. Historically, my server's used SHA1 certificates, and I want to move to SHA256 certificate, but I've got embedded clients which are hard to change, so I need to support both, at least for a while. Can I persuade OTP to offer a different server certificate depending on the client? I can't use (e.g.) SNI, because the client doesn't provide the server_name extension. Thanks, Roger. From codewiget95@REDACTED Wed Jul 12 22:42:03 2017 From: codewiget95@REDACTED (code wiget) Date: Wed, 12 Jul 2017 16:42:03 -0400 Subject: [erlang-questions] Working with Cuttlefish Message-ID: <98BE08C8-5C90-456E-9D52-D3C7A27D4B21@gmail.com> Hello everyone, Right now I am working on configuring EMQ support for PSKs. My first goal was to create a client/server that used psks, which is now operational. The biggest part of this was being able to pass ssl:listen the correct parameters, specifically {ciphers, [{ciphers, [{psk, aes_256_cbc, sha}]},{user_lookup_fun, {fun user_lookup/3, ?PskSharedSecret}}, where the shared secret is binary. Now that that is complete, the big task has been enabling it on EMQ, and to do this it was necessary to pass the correct SslOpts from the config file. So, I modified the emq.schema like so: SslOpts = fun(Prefix) -> ? Filter([{versions, Versions}, {ciphers, {psk, aes_256_cbc, sha}}, But If I set the next line to : {user_lookup_fun, {fun user_lookup/3, ?PskSharedSecret}} the schema parser fails, it can?t parse this. How could I write this so that it would be parsed? Or if anyone has any tips or a reference I would also greatly appreciate that, as I am hitting a brick wall. Thank you for your time. From scohen@REDACTED Thu Jul 13 01:10:22 2017 From: scohen@REDACTED (Steve Cohen) Date: Wed, 12 Jul 2017 16:10:22 -0700 Subject: [erlang-questions] Erlang VM hanging on node death In-Reply-To: References: Message-ID: Juan, Here's the sequence of events: 1. One of our machines was inadvertently shut off, killing all of the processes on it 2. We immediately saw a drop in CPU across the board on the sessions cluster. CPU on the sessions cluster eventually went to zero. 3. We were completely unable to use remote console on any of the machines in the cluster, and they all needed to be restarted. So, to answer your question, we don't know how long it took for down messages to be processed, since we didn't have visibility at the time. We suspected a problem with the net_ticktime, but what's confusing to us is that the host that went down went down hard, so the DOWN events should have been created on the other nodes, not sent across distribution (correct me if I'm wrong here). Also, my intuition is that processing DOWN messages would cause CPU usage on the cluster to go up, but we saw the exact opposite. Since we couldn't connect to the machines via remote console, we couldn't call connect_node. It was my understanding that the connect call would happen when the node in question reestablished itself. On Tue, Jul 11, 2017 at 8:34 PM, Juan Jose Comellas wrote: > How long does it take for all the DOWN messages to be sent/processed? > > These messages might not be allowing the net tick messages (see > net_ticktime in http://erlang.org/doc/man/kernel_app.html) to be > responded in time. If this happens, the node that isn't able to respond > before the net_ticktime expires will be assumed to be disconnected. > > What happens if after processing all the DOWN messages you issue a call to > net_kernel:connect_node/1 for each of the nodes that seems to be down? > > On Mon, Jul 10, 2017 at 4:14 PM, Steve Cohen > wrote: > >> Hi all, >> >> We have 12 nodes in a our guilds cluster, and on each, 500,000 >> processes. We have another cluster that has 15 nodes with roughly four >> million processes on it, called sessions. Both clusters are in the same >> erlang distribution since our guilds monitor sessions and vice-versa. >> >> Now, when one of our guild servers dies, as expected it generates a large >> number of DOWN messages to the sessions cluster. These messages bog down >> the sessions servers (obviously) while they process them, but when they're >> done processing, distribution appears to be completely broken. >> >> By broken, I mean that the nodes are disconnected from one another, >> they're not exchanging messages, CPU usage was 0 and we couldn't even >> launch the remote console. >> >> I can't imagine this is expected behavior, and was wondering if someone >> can shed some light on it. >> We're open to the idea that we're doing something very, very wrong. >> >> >> Thanks in advance for the help >> >> -- >> Steve Cohen >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- -Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Thu Jul 13 09:12:25 2017 From: lukas@REDACTED (Lukas Larsson) Date: Thu, 13 Jul 2017 09:12:25 +0200 Subject: [erlang-questions] Erlang VM hanging on node death In-Reply-To: References: Message-ID: Hello Steve, On Mon, Jul 10, 2017 at 4:14 PM, Steve Cohen wrote: > Now, when one of our guild servers dies, as expected it generates a large > number of DOWN messages to the sessions cluster. These messages bog down > the sessions servers (obviously) while they process them, but when they're > done processing, distribution appears to be completely broken. > > On Thu, Jul 13, 2017 at 1:10 AM, Steve Cohen wrote: > Here's the sequence of events: > 1. One of our machines was inadvertently shut off, killing all of the > processes on it > 2. We immediately saw a drop in CPU across the board on the sessions > cluster. CPU on the sessions cluster eventually went to zero. > 3. We were completely unable to use remote console on any of the machines > in the cluster, and they all needed to be restarted. > The two scenarios you are describing seem to contradict each other? First you talk about the sessions servers being bogged down, and then that the CPU of the sessions cluster went to almost zero? What is it that I'm missing? Did you gather any port mortem dumps from these machines? i.e. a erl_crash.dump or a core dump? Also you have forgotten to mention what version of Erlang/OTP that you are using. > So, to answer your question, we don't know how long it took for down > messages to be processed, since we didn't have visibility at the time. We > suspected a problem with the net_ticktime, but what's confusing to us is > that the host that went down went down hard, so the DOWN events should have > been created on the other nodes, not sent across distribution (correct me > if I'm wrong here). > When a TCP connection used for the erlang distribution is terminated, all the down messages are (as you say) generated locally. > Also, my intuition is that processing DOWN messages would cause CPU usage > on the cluster to go up, but we saw the exact opposite. > > With the poweroff of the machine, are you sure that the TCP layer caught the shutdown? If it didn't, then the next fail-safe is the net_ticktime. > Since we couldn't connect to the machines via remote console, we couldn't > call connect_node. It was my understanding that the connect call would > happen when the node in question reestablished itself. > Yes, it should re-connect when needed. It is quite strange that you couldn't connect via remote shell. A crash dump or core dump would really help to understand what is going on. > > > On Tue, Jul 11, 2017 at 8:34 PM, Juan Jose Comellas > wrote: > >> How long does it take for all the DOWN messages to be sent/processed? >> >> These messages might not be allowing the net tick messages (see >> net_ticktime in http://erlang.org/doc/man/kernel_app.html) to be >> responded in time. If this happens, the node that isn't able to respond >> before the net_ticktime expires will be assumed to be disconnected. >> >> What happens if after processing all the DOWN messages you issue a call >> to net_kernel:connect_node/1 for each of the nodes that seems to be down? >> >> On Mon, Jul 10, 2017 at 4:14 PM, Steve Cohen >> wrote: >> >>> Hi all, >>> >>> We have 12 nodes in a our guilds cluster, and on each, 500,000 >>> processes. We have another cluster that has 15 nodes with roughly four >>> million processes on it, called sessions. Both clusters are in the same >>> erlang distribution since our guilds monitor sessions and vice-versa. >>> >>> Now, when one of our guild servers dies, as expected it generates a >>> large number of DOWN messages to the sessions cluster. These messages bog >>> down the sessions servers (obviously) while they process them, but when >>> they're done processing, distribution appears to be completely broken. >>> >>> By broken, I mean that the nodes are disconnected from one another, >>> they're not exchanging messages, CPU usage was 0 and we couldn't even >>> launch the remote console. >>> >>> I can't imagine this is expected behavior, and was wondering if someone >>> can shed some light on it. >>> We're open to the idea that we're doing something very, very wrong. >>> >>> >>> Thanks in advance for the help >>> >>> -- >>> Steve Cohen >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> > > > -- > -Steve > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ml_news@REDACTED Thu Jul 13 09:12:46 2017 From: ml_news@REDACTED (Manfred Lotz) Date: Thu, 13 Jul 2017 09:12:46 +0200 Subject: [erlang-questions] Do you know what your code is doing at night? In-Reply-To: <20170710173806.GI22798@ferdmbp.local> References: <20170710173806.GI22798@ferdmbp.local> Message-ID: <20170713091246.79444242@hogwart.bsdlocal.net> Hi Fred, I'm an Erlang beginner so I'm not the best qualified guy to make comments. Nevertheless, I took a look and I must say you are an extremely good writer (ok, no surprise looking at your LYSE book). Hopefully, in August I will have more time to work thorougly thru your article. Then I will give you some more feedback. However, I have a general question: Are unit testing and property based testing to be seen as both complementing each other, or is property based testing to be regarded to fully replace unit testing as it should (?) cover a proper superset of the tests in unit testing? Thanks a lot. -- Best, Manfred On Mon, 10 Jul 2017 13:38:08 -0400 Fred Hebert wrote: > Hello everyone, > > If you've been curious about property-based testing for a while but > found it kind of intimidating or didn't really feel like digging in > the source or asking bloggers or people who implement their own > libraries to get going, I've got a thing you might like. > > I've been assembling my own notes on property-based testing over the > last few months, and have just made http://propertesting.com/ public, > even if it is not fully complete yet. > > Hopefully, if you're one of those people who want to figure out what > the properties of their code is or you want to make sure they're > actually enforced properly, this could be of help. Have a read and > let me know what you think. > > Regards, > Fred. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From essen@REDACTED Thu Jul 13 09:46:09 2017 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Thu, 13 Jul 2017 09:46:09 +0200 Subject: [erlang-questions] Do you know what your code is doing at night? In-Reply-To: <20170713091246.79444242@hogwart.bsdlocal.net> References: <20170710173806.GI22798@ferdmbp.local> <20170713091246.79444242@hogwart.bsdlocal.net> Message-ID: On 07/13/2017 09:12 AM, Manfred Lotz wrote: > However, I have a general question: > > Are unit testing and property based testing to be seen as both > complementing each other, or is property based testing to be regarded > to fully replace unit testing as it should (?) cover a proper superset > of the tests in unit testing? I'm not Fred, but I do have some insight on that. Property based testing can largely replace the few random unit tests you would write to test cases that you think about. It will also test cases that you will not think about, and that's good. Unit testing is still useful to make sure the textbook cases still work though. If you have a spec (like an RFC) with some examples, you will want to write unit tests for those, because properties are code and might not be perfect. And similarly, unit testing is still useful for testing against regressions. Even if you fix your property, you should write a unit test with the previously failing case to make sure you don't break your code and your property again. -- Lo?c Hoguin https://ninenines.eu From yzh44yzh@REDACTED Thu Jul 13 10:27:48 2017 From: yzh44yzh@REDACTED (Yuri Zhloba) Date: Thu, 13 Jul 2017 11:27:48 +0300 Subject: [erlang-questions] Spacemacs EDTS layer or something w/ symbol lookup In-Reply-To: References: Message-ID: Intellij IDEA Community Edition has a good Erlang plugin. 2017-06-30 9:44 GMT+03:00 Dan Gudmundsson : > tags works for me in normal emacs. > > > On Thu, Jun 29, 2017 at 7:52 PM Joel Reymont wrote: >> >> Folks, >> >> Does anyone have a Spacemacs layer for EDTS? >> >> Alternatively, is there something with go-to-symbol functionality, for >> either Emacs, VS Code or Sublime? >> >> Thanks, Joel >> >> -- >> __ >> http://linkedin.com/in/joelreymont >> Go, Rust hacker. Blockchain, Bitcoin, Ethereum >> and cryptocurrency geek. Can write compilers >> and VMs for your smart contracts. Hire me! >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Yuri Zhloba skype: yzh44yzh phone: +375 44 793 33 73 From mohammedmazharuddin@REDACTED Thu Jul 13 12:16:47 2017 From: mohammedmazharuddin@REDACTED (Mohammed mazhar uddin) Date: Thu, 13 Jul 2017 15:46:47 +0530 Subject: [erlang-questions] Installation package for wxerlang project Message-ID: Hi all, How can i create installation package for wxerlang project? Please revert with complete procedure for creating installation package. Thank you, Mohammed Mazhar Uddin. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Thu Jul 13 13:09:52 2017 From: mononcqc@REDACTED (Fred Hebert) Date: Thu, 13 Jul 2017 07:09:52 -0400 Subject: [erlang-questions] Do you know what your code is doing at night? In-Reply-To: References: <20170710173806.GI22798@ferdmbp.local> <20170713091246.79444242@hogwart.bsdlocal.net> Message-ID: <20170713110951.GK22798@ferdmbp.local> I pretty much agree with Lo?c here. I'd say standard tests will still make sense for: - working around when finding a good property is really hard and/or taking time, especially if you're on a tighter schedule, even more likely to happen as a beginner. - To augment a property. For example, the classic 'decode(encode(X)) == X' case is made stronger if you have ways to say what the encoded format should look like as well. Regular tests can work as 'anchors' that cover some edges that are hard to do as a property - To store counter-examples of past failures as regression suites - To write some explicit examples of your code to ensure it works (as Lo?c mentioned, RFCs are a good source of that) - As a way to get started writing your properties (write a few examples, and *then* generalize them into a property) The anchoring bit is a kind of important one, especially since if you're not careful, it's easy to over-estimate the quality of property test. Usual tricks to help there (aside from anchoring with regular tests) will be to: - look at coverage - look at the statistics of the distribution of the generators - do negative testing of your tests (break the code on purpose in a subtle way, make sure one property finds the error) So the TL:DR; would probably be that a bunch of unit tests are complementary, but a bunch of them can be made redundant as well. On 07/13, Lo?c Hoguin wrote: >On 07/13/2017 09:12 AM, Manfred Lotz wrote: >>However, I have a general question: >> >>Are unit testing and property based testing to be seen as both >>complementing each other, or is property based testing to be regarded >>to fully replace unit testing as it should (?) cover a proper superset >>of the tests in unit testing? >I'm not Fred, but I do have some insight on that. > >Property based testing can largely replace the few random unit tests >you would write to test cases that you think about. It will also test >cases that you will not think about, and that's good. > >Unit testing is still useful to make sure the textbook cases still >work though. If you have a spec (like an RFC) with some examples, you >will want to write unit tests for those, because properties are code >and might not be perfect. > >And similarly, unit testing is still useful for testing against >regressions. Even if you fix your property, you should write a unit >test with the previously failing case to make sure you don't break >your code and your property again. > >-- >Lo?c Hoguin >https://ninenines.eu >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions From ml_news@REDACTED Thu Jul 13 13:12:12 2017 From: ml_news@REDACTED (Manfred Lotz) Date: Thu, 13 Jul 2017 13:12:12 +0200 Subject: [erlang-questions] Do you know what your code is doing at night? In-Reply-To: References: <20170710173806.GI22798@ferdmbp.local> <20170713091246.79444242@hogwart.bsdlocal.net> Message-ID: <20170713131212.5eb891ab@hogwart.bsdlocal.net> Hi Loic, Thanks for your reply. On Thu, 13 Jul 2017 09:46:09 +0200 Lo?c Hoguin wrote: > On 07/13/2017 09:12 AM, Manfred Lotz wrote: > > However, I have a general question: > > > > Are unit testing and property based testing to be seen as both > > complementing each other, or is property based testing to be > > regarded to fully replace unit testing as it should (?) cover a > > proper superset of the tests in unit testing? > I'm not Fred, but I do have some insight on that. > > Property based testing can largely replace the few random unit tests > you would write to test cases that you think about. It will also test > cases that you will not think about, and that's good. > > Unit testing is still useful to make sure the textbook cases still > work though. If you have a spec (like an RFC) with some examples, you > will want to write unit tests for those, because properties are code > and might not be perfect. > > And similarly, unit testing is still useful for testing against > regressions. Even if you fix your property, you should write a unit > test with the previously failing case to make sure you don't break > your code and your property again. > Your reply is absolutely excellent, and makes much sense to me. I think Fred could add a section "Unit testing versus property based testing" and add your explanations. Many thanks, Manfred From mononcqc@REDACTED Thu Jul 13 13:16:06 2017 From: mononcqc@REDACTED (Fred Hebert) Date: Thu, 13 Jul 2017 07:16:06 -0400 Subject: [erlang-questions] Do you know what your code is doing at night? In-Reply-To: <20170713131212.5eb891ab@hogwart.bsdlocal.net> References: <20170710173806.GI22798@ferdmbp.local> <20170713091246.79444242@hogwart.bsdlocal.net> <20170713131212.5eb891ab@hogwart.bsdlocal.net> Message-ID: <20170713111606.GL22798@ferdmbp.local> On 07/13, Manfred Lotz wrote: >I think Fred could add a section "Unit testing versus property based >testing" and add your explanations. > Similar content is already part of the book, though not necessarily in a dedicated section. From ml_news@REDACTED Thu Jul 13 15:11:15 2017 From: ml_news@REDACTED (Manfred Lotz) Date: Thu, 13 Jul 2017 15:11:15 +0200 Subject: [erlang-questions] Do you know what your code is doing at night? In-Reply-To: <20170713111606.GL22798@ferdmbp.local> References: <20170710173806.GI22798@ferdmbp.local> <20170713091246.79444242@hogwart.bsdlocal.net> <20170713131212.5eb891ab@hogwart.bsdlocal.net> <20170713111606.GL22798@ferdmbp.local> Message-ID: <20170713151115.30e5c959@hogwart.bsdlocal.net> On Thu, 13 Jul 2017 07:16:06 -0400 Fred Hebert wrote: > On 07/13, Manfred Lotz wrote: > >I think Fred could add a section "Unit testing versus property based > >testing" and add your explanations. > > > > Similar content is already part of the book, though not necessarily > in a dedicated section. I think it is worth to make your and Loic's answer a dedicated section or subsection. -- Manfred From scohen@REDACTED Thu Jul 13 19:26:23 2017 From: scohen@REDACTED (Steve Cohen) Date: Thu, 13 Jul 2017 10:26:23 -0700 Subject: [erlang-questions] Erlang VM hanging on node death In-Reply-To: References: Message-ID: Lukas, The second situation is more representative of what happened; CPU quickly trended towards zero, and the VMs were unresponsive. The situation was stable, and didn't generate an erl_crash.dump or a core dump. Next time this happens, we'll try to trigger one. Since we couldn't get into the VMs, all we have to go on is telemetry, which isn't as accurate as being in the remote console. If it helps, I'd be glad to share our telemetry data. The entire cluster immediately experienced a drop in CPU. It was quite strange. Agreed about the remote shell, I guess without a dump, we're stuck. On Thu, Jul 13, 2017 at 12:12 AM, Lukas Larsson wrote: > Hello Steve, > > On Mon, Jul 10, 2017 at 4:14 PM, Steve Cohen > wrote: > >> Now, when one of our guild servers dies, as expected it generates a large >> number of DOWN messages to the sessions cluster. These messages bog down >> the sessions servers (obviously) while they process them, but when they're >> done processing, distribution appears to be completely broken. >> >> > On Thu, Jul 13, 2017 at 1:10 AM, Steve Cohen > wrote: > >> Here's the sequence of events: >> > 1. One of our machines was inadvertently shut off, killing all of the >> processes on it >> 2. We immediately saw a drop in CPU across the board on the sessions >> cluster. CPU on the sessions cluster eventually went to zero. >> 3. We were completely unable to use remote console on any of the machines >> in the cluster, and they all needed to be restarted. >> > > The two scenarios you are describing seem to contradict each other? First > you talk about the sessions servers being bogged down, and then that the > CPU of the sessions cluster went to almost zero? What is it that I'm > missing? > > Did you gather any port mortem dumps from these machines? i.e. a > erl_crash.dump or a core dump? > > Also you have forgotten to mention what version of Erlang/OTP that you are > using. > > >> So, to answer your question, we don't know how long it took for down >> messages to be processed, since we didn't have visibility at the time. We >> suspected a problem with the net_ticktime, but what's confusing to us is >> that the host that went down went down hard, so the DOWN events should have >> been created on the other nodes, not sent across distribution (correct me >> if I'm wrong here). >> > > When a TCP connection used for the erlang distribution is terminated, all > the down messages are (as you say) generated locally. > > >> Also, my intuition is that processing DOWN messages would cause CPU usage >> on the cluster to go up, but we saw the exact opposite. >> >> > With the poweroff of the machine, are you sure that the TCP layer caught > the shutdown? If it didn't, then the next fail-safe is the net_ticktime. > > >> Since we couldn't connect to the machines via remote console, we couldn't >> call connect_node. It was my understanding that the connect call would >> happen when the node in question reestablished itself. >> > > Yes, it should re-connect when needed. It is quite strange that you > couldn't connect via remote shell. A crash dump or core dump would really > help to understand what is going on. > > >> >> >> On Tue, Jul 11, 2017 at 8:34 PM, Juan Jose Comellas >> wrote: >> >>> How long does it take for all the DOWN messages to be sent/processed? >>> >>> These messages might not be allowing the net tick messages (see >>> net_ticktime in http://erlang.org/doc/man/kernel_app.html) to be >>> responded in time. If this happens, the node that isn't able to respond >>> before the net_ticktime expires will be assumed to be disconnected. >>> >>> What happens if after processing all the DOWN messages you issue a call >>> to net_kernel:connect_node/1 for each of the nodes that seems to be >>> down? >>> >>> On Mon, Jul 10, 2017 at 4:14 PM, Steve Cohen >>> wrote: >>> >>>> Hi all, >>>> >>>> We have 12 nodes in a our guilds cluster, and on each, 500,000 >>>> processes. We have another cluster that has 15 nodes with roughly four >>>> million processes on it, called sessions. Both clusters are in the same >>>> erlang distribution since our guilds monitor sessions and vice-versa. >>>> >>>> Now, when one of our guild servers dies, as expected it generates a >>>> large number of DOWN messages to the sessions cluster. These messages bog >>>> down the sessions servers (obviously) while they process them, but when >>>> they're done processing, distribution appears to be completely broken. >>>> >>>> By broken, I mean that the nodes are disconnected from one another, >>>> they're not exchanging messages, CPU usage was 0 and we couldn't even >>>> launch the remote console. >>>> >>>> I can't imagine this is expected behavior, and was wondering if someone >>>> can shed some light on it. >>>> We're open to the idea that we're doing something very, very wrong. >>>> >>>> >>>> Thanks in advance for the help >>>> >>>> -- >>>> Steve Cohen >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> >> >> >> -- >> -Steve >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- -Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From juanjo@REDACTED Thu Jul 13 19:58:15 2017 From: juanjo@REDACTED (Juan Jose Comellas) Date: Thu, 13 Jul 2017 14:58:15 -0300 Subject: [erlang-questions] Erlang VM hanging on node death In-Reply-To: References: Message-ID: Steve, is it possible that the processes were trying to contact other processes on the node that went down and were blocking in responses from them? If so, do you have timeouts in the calls you make to those processes. Also, are you referencing the remote processes in the node that went down by pid or by global name? As Lukas said, it's difficult to know what happened without more information, but the answers to the questions above might shed some light on the cause(s) of the problem. On Thu, Jul 13, 2017 at 2:26 PM, Steve Cohen wrote: > Lukas, > The second situation is more representative of what happened; CPU quickly > trended towards zero, and the VMs were unresponsive. The situation was > stable, and didn't generate an erl_crash.dump or a core dump. Next time > this happens, we'll try to trigger one. > > Since we couldn't get into the VMs, all we have to go on is telemetry, > which isn't as accurate as being in the remote console. If it helps, I'd be > glad to share our telemetry data. The entire cluster immediately > experienced a drop in CPU. It was quite strange. > > Agreed about the remote shell, I guess without a dump, we're stuck. > > > On Thu, Jul 13, 2017 at 12:12 AM, Lukas Larsson wrote: > >> Hello Steve, >> >> On Mon, Jul 10, 2017 at 4:14 PM, Steve Cohen >> wrote: >> >>> Now, when one of our guild servers dies, as expected it generates a >>> large number of DOWN messages to the sessions cluster. These messages bog >>> down the sessions servers (obviously) while they process them, but when >>> they're done processing, distribution appears to be completely broken. >>> >>> >> On Thu, Jul 13, 2017 at 1:10 AM, Steve Cohen >> wrote: >> >>> Here's the sequence of events: >>> >> 1. One of our machines was inadvertently shut off, killing all of the >>> processes on it >>> 2. We immediately saw a drop in CPU across the board on the sessions >>> cluster. CPU on the sessions cluster eventually went to zero. >>> 3. We were completely unable to use remote console on any of the >>> machines in the cluster, and they all needed to be restarted. >>> >> >> The two scenarios you are describing seem to contradict each other? First >> you talk about the sessions servers being bogged down, and then that the >> CPU of the sessions cluster went to almost zero? What is it that I'm >> missing? >> >> Did you gather any port mortem dumps from these machines? i.e. a >> erl_crash.dump or a core dump? >> >> Also you have forgotten to mention what version of Erlang/OTP that you >> are using. >> >> >>> So, to answer your question, we don't know how long it took for down >>> messages to be processed, since we didn't have visibility at the time. We >>> suspected a problem with the net_ticktime, but what's confusing to us is >>> that the host that went down went down hard, so the DOWN events should have >>> been created on the other nodes, not sent across distribution (correct me >>> if I'm wrong here). >>> >> >> When a TCP connection used for the erlang distribution is terminated, all >> the down messages are (as you say) generated locally. >> >> >>> Also, my intuition is that processing DOWN messages would cause CPU >>> usage on the cluster to go up, but we saw the exact opposite. >>> >>> >> With the poweroff of the machine, are you sure that the TCP layer caught >> the shutdown? If it didn't, then the next fail-safe is the net_ticktime. >> >> >>> Since we couldn't connect to the machines via remote console, we >>> couldn't call connect_node. It was my understanding that the connect call >>> would happen when the node in question reestablished itself. >>> >> >> Yes, it should re-connect when needed. It is quite strange that you >> couldn't connect via remote shell. A crash dump or core dump would really >> help to understand what is going on. >> >> >>> >>> >>> On Tue, Jul 11, 2017 at 8:34 PM, Juan Jose Comellas >> > wrote: >>> >>>> How long does it take for all the DOWN messages to be sent/processed? >>>> >>>> These messages might not be allowing the net tick messages (see >>>> net_ticktime in http://erlang.org/doc/man/kernel_app.html) to be >>>> responded in time. If this happens, the node that isn't able to respond >>>> before the net_ticktime expires will be assumed to be disconnected. >>>> >>>> What happens if after processing all the DOWN messages you issue a call >>>> to net_kernel:connect_node/1 for each of the nodes that seems to be >>>> down? >>>> >>>> On Mon, Jul 10, 2017 at 4:14 PM, Steve Cohen >>>> wrote: >>>> >>>>> Hi all, >>>>> >>>>> We have 12 nodes in a our guilds cluster, and on each, 500,000 >>>>> processes. We have another cluster that has 15 nodes with roughly four >>>>> million processes on it, called sessions. Both clusters are in the same >>>>> erlang distribution since our guilds monitor sessions and vice-versa. >>>>> >>>>> Now, when one of our guild servers dies, as expected it generates a >>>>> large number of DOWN messages to the sessions cluster. These messages bog >>>>> down the sessions servers (obviously) while they process them, but when >>>>> they're done processing, distribution appears to be completely broken. >>>>> >>>>> By broken, I mean that the nodes are disconnected from one another, >>>>> they're not exchanging messages, CPU usage was 0 and we couldn't even >>>>> launch the remote console. >>>>> >>>>> I can't imagine this is expected behavior, and was wondering if >>>>> someone can shed some light on it. >>>>> We're open to the idea that we're doing something very, very wrong. >>>>> >>>>> >>>>> Thanks in advance for the help >>>>> >>>>> -- >>>>> Steve Cohen >>>>> >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>> >>>>> >>>> >>> >>> >>> -- >>> -Steve >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> > > > -- > -Steve > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Thu Jul 13 21:43:06 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Thu, 13 Jul 2017 19:43:06 +0000 Subject: [erlang-questions] Erlang VM hanging on node death In-Reply-To: References: Message-ID: Very little to go by. My recommendation would be to analyze bottom up through the layers if possible. Telemetry of IO is useful. The Erlang VM tracks this. Telemetry of port and process count as well. A sharp drop in CPU load would suggest processes are blocked on something and waiting for stuff to happen. By working from the network and up, you can often gain valuable information which can be used to rule out hypothesis underway. What does your logger say about the situation? Anything odd in those logs? Do you run with system_monitor enabled and does it mention something? Crash logs? Do you run with exometer_core or something such in the cluster (you should! establish a baseline of typical operation so you know when things look weird. You really want measurement on the critical paths, at least sampling. Otherwise you have no chance at scaling the load over time). What does the kernel say about TCP send queues on the distribution channels? Are the TCP windows there closed or open? The usual way is to form some kind of hypothesis. Then devise a method to either confirm or reject the hypothesis. Then form a new one and so on. Write down everything you find in a document which is shared among investigators (Git or Google Docs, etc). Track knowledge. One thing which is very important to look out for are assumptions. If you have an assumption, you should figure out a way to determine if it is true or not. You are most often lead astray by an incorrect assumption somewhere in the chain of events. And this has you hunting for a problem in a corner of the system where no problems occur. Other haphazard list of stuff: - any nasty NIFs? - dTrace on the boxes? (Godsend when things go wrong) - Consider establishing an Erlang shell early if it is a resource problem. Then one is handy when things start going wrong. - Can you provoke the error in a smaller test cluster? Possibly be artificially resource constraining its network devices as well? - If you can't create a shell, something rather central could be hosed. Try figuring out if you ran out of resources etc. - A slow disk coupled with synchronous calls can easily block a machine - Excessive debug logging too, but that would max out the CPU load - The problem might not even be in Erlang. Everything from faulty hardware, faulty kernel, bad cloud provider, to Elixir or LFE might be the culprit. Narrowing down the list of likely candidates is important. On Thu, Jul 13, 2017 at 7:58 PM Juan Jose Comellas wrote: > Steve, is it possible that the processes were trying to contact other > processes on the node that went down and were blocking in responses from > them? If so, do you have timeouts in the calls you make to those processes. > Also, are you referencing the remote processes in the node that went down > by pid or by global name? > > As Lukas said, it's difficult to know what happened without more > information, but the answers to the questions above might shed some light > on the cause(s) of the problem. > > On Thu, Jul 13, 2017 at 2:26 PM, Steve Cohen > wrote: > >> Lukas, >> The second situation is more representative of what happened; CPU quickly >> trended towards zero, and the VMs were unresponsive. The situation was >> stable, and didn't generate an erl_crash.dump or a core dump. Next time >> this happens, we'll try to trigger one. >> >> Since we couldn't get into the VMs, all we have to go on is telemetry, >> which isn't as accurate as being in the remote console. If it helps, I'd be >> glad to share our telemetry data. The entire cluster immediately >> experienced a drop in CPU. It was quite strange. >> >> Agreed about the remote shell, I guess without a dump, we're stuck. >> >> >> On Thu, Jul 13, 2017 at 12:12 AM, Lukas Larsson wrote: >> >>> Hello Steve, >>> >>> On Mon, Jul 10, 2017 at 4:14 PM, Steve Cohen >>> wrote: >>> >>>> Now, when one of our guild servers dies, as expected it generates a >>>> large number of DOWN messages to the sessions cluster. These messages bog >>>> down the sessions servers (obviously) while they process them, but when >>>> they're done processing, distribution appears to be completely broken. >>>> >>>> >>> On Thu, Jul 13, 2017 at 1:10 AM, Steve Cohen >>> wrote: >>> >>>> Here's the sequence of events: >>>> >>> 1. One of our machines was inadvertently shut off, killing all of the >>>> processes on it >>>> 2. We immediately saw a drop in CPU across the board on the sessions >>>> cluster. CPU on the sessions cluster eventually went to zero. >>>> 3. We were completely unable to use remote console on any of the >>>> machines in the cluster, and they all needed to be restarted. >>>> >>> >>> The two scenarios you are describing seem to contradict each other? >>> First you talk about the sessions servers being bogged down, and then that >>> the CPU of the sessions cluster went to almost zero? What is it that I'm >>> missing? >>> >>> Did you gather any port mortem dumps from these machines? i.e. a >>> erl_crash.dump or a core dump? >>> >>> Also you have forgotten to mention what version of Erlang/OTP that you >>> are using. >>> >>> >>>> So, to answer your question, we don't know how long it took for down >>>> messages to be processed, since we didn't have visibility at the time. We >>>> suspected a problem with the net_ticktime, but what's confusing to us is >>>> that the host that went down went down hard, so the DOWN events should have >>>> been created on the other nodes, not sent across distribution (correct me >>>> if I'm wrong here). >>>> >>> >>> When a TCP connection used for the erlang distribution is terminated, >>> all the down messages are (as you say) generated locally. >>> >>> >>>> Also, my intuition is that processing DOWN messages would cause CPU >>>> usage on the cluster to go up, but we saw the exact opposite. >>>> >>>> >>> With the poweroff of the machine, are you sure that the TCP layer caught >>> the shutdown? If it didn't, then the next fail-safe is the net_ticktime. >>> >>> >>>> Since we couldn't connect to the machines via remote console, we >>>> couldn't call connect_node. It was my understanding that the connect call >>>> would happen when the node in question reestablished itself. >>>> >>> >>> Yes, it should re-connect when needed. It is quite strange that you >>> couldn't connect via remote shell. A crash dump or core dump would really >>> help to understand what is going on. >>> >>> >>>> >>>> >>>> On Tue, Jul 11, 2017 at 8:34 PM, Juan Jose Comellas < >>>> juanjo@REDACTED> wrote: >>>> >>>>> How long does it take for all the DOWN messages to be sent/processed? >>>>> >>>>> These messages might not be allowing the net tick messages (see >>>>> net_ticktime in http://erlang.org/doc/man/kernel_app.html) to be >>>>> responded in time. If this happens, the node that isn't able to respond >>>>> before the net_ticktime expires will be assumed to be disconnected. >>>>> >>>>> What happens if after processing all the DOWN messages you issue a >>>>> call to net_kernel:connect_node/1 for each of the nodes that seems to >>>>> be down? >>>>> >>>>> On Mon, Jul 10, 2017 at 4:14 PM, Steve Cohen >>>>> wrote: >>>>> >>>>>> Hi all, >>>>>> >>>>>> We have 12 nodes in a our guilds cluster, and on each, 500,000 >>>>>> processes. We have another cluster that has 15 nodes with roughly four >>>>>> million processes on it, called sessions. Both clusters are in the same >>>>>> erlang distribution since our guilds monitor sessions and vice-versa. >>>>>> >>>>>> Now, when one of our guild servers dies, as expected it generates a >>>>>> large number of DOWN messages to the sessions cluster. These messages bog >>>>>> down the sessions servers (obviously) while they process them, but when >>>>>> they're done processing, distribution appears to be completely broken. >>>>>> >>>>>> By broken, I mean that the nodes are disconnected from one another, >>>>>> they're not exchanging messages, CPU usage was 0 and we couldn't even >>>>>> launch the remote console. >>>>>> >>>>>> I can't imagine this is expected behavior, and was wondering if >>>>>> someone can shed some light on it. >>>>>> We're open to the idea that we're doing something very, very wrong. >>>>>> >>>>>> >>>>>> Thanks in advance for the help >>>>>> >>>>>> -- >>>>>> Steve Cohen >>>>>> >>>>>> _______________________________________________ >>>>>> erlang-questions mailing list >>>>>> erlang-questions@REDACTED >>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>> >>>>>> >>>>> >>>> >>>> >>>> -- >>>> -Steve >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> >> >> >> -- >> -Steve >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Thu Jul 13 23:01:17 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Thu, 13 Jul 2017 21:01:17 +0000 Subject: [erlang-questions] Do you know what your code is doing at night? In-Reply-To: <20170713151115.30e5c959@hogwart.bsdlocal.net> References: <20170710173806.GI22798@ferdmbp.local> <20170713091246.79444242@hogwart.bsdlocal.net> <20170713131212.5eb891ab@hogwart.bsdlocal.net> <20170713111606.GL22798@ferdmbp.local> <20170713151115.30e5c959@hogwart.bsdlocal.net> Message-ID: The question of linking unit tests and property based testing has been covered by Gerdes, Hughes, Smallbone, and Wang: http://www.cse.chalmers.se/~nicsma/papers/unit-tests.pdf The idea here is to ask: Suppose we have a property based test suite and a set of unit tests. Can we check if the unit tests are already covered by the property suite? The paper answers this in the affirmative. You can construct a system which can answer the question, with great probability. It is highly useful in the case where you have a specification and the specification contains certain examples. By making sure your suite covers those examples, you gain the knowledge that your suite is not totally off w.r.t the unit test examples. In a system with property based testing, you can often track each counterexample you've encountered in a small suite of things to try first. This allows you to quickly check for regressions rather than generating new traces to try. OTOH, if you don't regularly generate the cases, then chances are your generator is off and not being evil enough >:-) On Thu, Jul 13, 2017 at 3:11 PM Manfred Lotz wrote: > On Thu, 13 Jul 2017 07:16:06 -0400 > Fred Hebert wrote: > > > On 07/13, Manfred Lotz wrote: > > >I think Fred could add a section "Unit testing versus property based > > >testing" and add your explanations. > > > > > > > Similar content is already part of the book, though not necessarily > > in a dedicated section. > > I think it is worth to make your and Loic's answer a dedicated section > or subsection. > > > -- > Manfred > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From publicityifl@REDACTED Thu Jul 13 22:13:44 2017 From: publicityifl@REDACTED (publicityifl@REDACTED) Date: Thu, 13 Jul 2017 20:13:44 +0000 Subject: [erlang-questions] 2nd CfP: IFL 2017 (29th Symposium on Implementation and Application of Functional Languages) Message-ID: <94eb2c14a222cff37905543891a2@google.com>
Hello,

Please, find below the second call for papers for IFL 2017.
Please forward these to anyone you think may be interested.
Apologies for any duplicates you may receive.

best regards,
Jurriaan Hage
Publicity Chair of IFL

---

IFL 2017 - CALL FOR PAPERS
==========================

29th SYMPOSIUM ON IMPLEMENTATION AND APPLICATION OF FUNCTIONAL LANGUAGES
========================================================================

University of Bristol, UK

In cooperation with ACM SIGPLAN

Wednesday 30 August - Friday 1 September, 2017

http://iflconference.org/

Scope
-----

The goal of the IFL symposia is to bring together researchers actively engaged
in the implementation and application of functional and function-based
programming languages. IFL 2017 will be a venue for researchers to present and
discuss new ideas and concepts, work in progress, and publication-ripe results
related to the implementation and application of functional languages and
function-based programming.

Peer-review
-----------

Following the IFL tradition, IFL 2017 will use a post-symposium review process
to produce the formal proceedings. All participants of IFL 2017 are invited to
submit either a draft paper or an extended abstract describing work to be
presented at the symposium. At no time may work submitted to IFL be
simultaneously submitted to other venues; submissions must adhere to ACM
SIGPLAN's republication policy:

http://www.sigplan.org/Resources/Policies/Republication

The submissions will be screened by the program committee chair to make sure
they are within the scope of IFL, and will appear in the draft proceedings
distributed at the symposium. Submissions appearing in the draft proceedings
are not peer-reviewed publications. Hence, publications that appear only in the
draft proceedings are not subject to the ACM SIGPLAN republication policy.
After the symposium, authors will be given the opportunity to incorporate the
feedback from discussions at the symposium and will be invited to submit a
revised full article for the formal review process. From the revised
submissions, the program committee will select papers for the formal
proceedings considering their correctness, novelty, originality, relevance,
significance, and clarity. The formal proceedings will appear in the
International Conference Proceedings Series of the ACM Digital Library.

Important dates
---------------

Mon 31 July???? 2017 : Submission deadline draft papers
Wed? 2 August?? 2017 : Notification of acceptance for presentation
Fri? 4 August?? 2017 : Early registration deadline
Fri 11 August?? 2017 : Late registration deadline
Mon 21 August?? 2017 : Submission deadline for pre-symposium proceedings
Wed 30 August?? 2017 - Fri 1 September 2017 : IFL Symposium
Mon? 4 December 2017 : Submission deadline for post-symposium proceedings
Wed 31 January? 2018 : Notification of acceptance for post-symposium proceedings
Mon 12 March??? 2018 : Camera-ready version for post-symposium proceedings

Submission details
------------------

Prospective authors are encouraged to submit papers or extended abstracts to be
published in the draft proceedings and to present them at the symposium. All
contributions must be written in English. Papers must use the new ACM two
columns conference format, which can be found at:

http://www.acm.org/publications/proceedings-template

For the pre-symposium proceedings we adopt a 'weak' page limit of 12 pages. For
the post-symposium proceedings the page limit of 12 pages is firm.

Authors submit through EasyChair:

https://easychair.org/conferences/?conf=ifl2017

Topics
------

IFL welcomes submissions describing practical and theoretical work as well as
submissions describing applications and tools in the context of functional
programming. If you are not sure whether your work is appropriate for IFL 2017,
please contact the PC chair at nicolas.wu@REDACTED. Topics of interest include,
but are not limited to:

- language concepts
- type systems, type checking, type inferencing
- compilation techniques
- staged compilation
- run-time function specialization
- run-time code generation
- partial evaluation
- (abstract) interpretation
- metaprogramming
- generic programming
- automatic program generation
- array processing
- concurrent/parallel programming
- concurrent/parallel program execution
- embedded systems
- web applications
- (embedded) domain specific languages
- security
- novel memory management techniques
- run-time profiling performance measurements
- debugging and tracing
- virtual/abstract machine architectures
- validation, verification of functional programs
- tools and programming techniques
- (industrial) applications

Peter Landin Prize
------------------

The Peter Landin Prize is awarded to the best paper presented at the symposium
every year. The honored article is selected by the program committee based on
the submissions received for the formal review process. The prize carries a
cash award equivalent to 150 Euros.

Programme committee
-------------------

Chair: Nicolas Wu, University of Bristol, UK

- Kenichi Asai, Ochanomizu University, Japan
- Sandrine Blazy, University of Rennes 1, France
- Carlos Camarao, Universidade Federal de Minas Gerais, Brazil
- Stephen Dolan, University of Cambridge, UK
- Jurriaan Hage, Utrecht University, Netherlands
- Yukiyoshi Kameyama, University of Tsukuba, Japan
- Benjamin Lerner, Brown University, USA
- Bas Lijnse, Radboud University, Netherlands
- Garrett Morris, University of Kansas, USA
- Miguel Pagano, Universidad Nacional de C??rdoba, Argentina
- Tomas Petricek, Alan Turing Institute, UK
- Maciej Pir??g, University of Wroclaw, Poland
- Exequiel Rivas, Universidad Nacional de Rosario, Argentina
- Neil Sculthorpe, Nottingham Trent University, UK
- Melinda Toth, Eotvos Lorand University, Hungary
- Phil Trinder, Glasgow University, UK
- Kanae Tsushima, National Institute of Informatics, Japan
- Marcos Viera, Universidad de la Republica, Uruguay
- Meng Wang, University of Kent, UK

Venue
-----

The IFL 2017 will be held in association with the Department of
Computer Science, University of Bristol, UK. Bristol is located in
South West England, and can be easily reached from Bristol Airport.
See the website for more information on the venue.

 

powered by GSM. Free mail merge and email marketing software for Gmail. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ml_news@REDACTED Fri Jul 14 09:10:22 2017 From: ml_news@REDACTED (Manfred Lotz) Date: Fri, 14 Jul 2017 09:10:22 +0200 Subject: [erlang-questions] Do you know what your code is doing at night? In-Reply-To: References: <20170710173806.GI22798@ferdmbp.local> <20170713091246.79444242@hogwart.bsdlocal.net> <20170713131212.5eb891ab@hogwart.bsdlocal.net> <20170713111606.GL22798@ferdmbp.local> <20170713151115.30e5c959@hogwart.bsdlocal.net> Message-ID: <20170714091022.4422d38f@hogwart.bsdlocal.net> On Thu, 13 Jul 2017 21:01:17 +0000 Jesper Louis Andersen wrote: > The question of linking unit tests and property based testing has been > covered by Gerdes, Hughes, Smallbone, and Wang: > > http://www.cse.chalmers.se/~nicsma/papers/unit-tests.pdf > > The idea here is to ask: Suppose we have a property based test suite > and a set of unit tests. Can we check if the unit tests are already > covered by the property suite? The paper answers this in the > affirmative. You can construct a system which can answer the > question, with great probability. > > It is highly useful in the case where you have a specification and the > specification contains certain examples. By making sure your suite > covers those examples, you gain the knowledge that your suite is not > totally off w.r.t the unit test examples. > > In a system with property based testing, you can often track each > counterexample you've encountered in a small suite of things to try > first. This allows you to quickly check for regressions rather than > generating new traces to try. OTOH, if you don't regularly generate > the cases, then chances are your generator is off and not being evil > enough >:-) > Thanks for this. Very interesting. Manfred From mikpelinux@REDACTED Fri Jul 14 15:01:49 2017 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Fri, 14 Jul 2017 15:01:49 +0200 Subject: [erlang-questions] core erlang apply requires variable in function position? Message-ID: <22888.49341.541459.110669@gargle.gargle.HOWL> This simple Core Erlang module fails to compile with OTP-20.0.1: > cat test1.core module 'test1' ['test1'/2] attributes [] 'i'/1 = fun (_f) -> _f 'test1'/2 = fun (_f, _x) -> apply apply 'i'/1 (_f) (_x) end > erlc test1.core no_file: Warning: invalid function call and the .beam produced just contains code to throw a badfun error. The warning comes from sys_core_fold:expr/3: expr(#c_apply{anno=Anno,op=Op0,args=As0}=App, _, Sub) -> Op1 = expr(Op0, value, Sub), As1 = expr_list(As0, value, Sub), case Op1 of #c_var{} -> App#c_apply{op=Op1,args=As1}; _ -> add_warning(App, invalid_call), ... indicating that it's not prepared to handle apply forms with anything but plain variables in the function position. This surprised me since: 1. I'm generating the above code using the cerl module's constructor functions which do not mention this restriction, and 2. the module so constructed passes core_lint:module/1, and 3. core_pp:format/1 is also happy with it, and 4. the Core Erlang language specification document doesn't restrict apply's function position beyond the general class of expressions. So is this restriction deliberate or unintentional? For now I work around it by wrapping the apply with a 'let' binding the function position expression to a temporary. /Mikael From dmytro.lytovchenko@REDACTED Fri Jul 14 15:22:13 2017 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Fri, 14 Jul 2017 15:22:13 +0200 Subject: [erlang-questions] core erlang apply requires variable in function position? In-Reply-To: <22888.49341.541459.110669@gargle.gargle.HOWL> References: <22888.49341.541459.110669@gargle.gargle.HOWL> Message-ID: My guess is that apply command in Core already implies that the code generator will emit apply/apply_last BEAM opcode which takes Arity * args, module in Arity'th and a function as Arity+1st register, i.e. there must be a register store command somewhere (which you do with a let). The decision itself whether to generate a call or an apply is made earlier in the compiler chain, and you're past it. see cerl_cconv:apply_expr 2017-07-14 15:01 GMT+02:00 Mikael Pettersson : > This simple Core Erlang module fails to compile with OTP-20.0.1: > > > cat test1.core > module 'test1' ['test1'/2] > attributes [] > 'i'/1 = > fun (_f) -> _f > 'test1'/2 = > fun (_f, _x) -> > apply apply 'i'/1 (_f) (_x) > end > > erlc test1.core > no_file: Warning: invalid function call > > and the .beam produced just contains code to throw a badfun error. > > The warning comes from sys_core_fold:expr/3: > > expr(#c_apply{anno=Anno,op=Op0,args=As0}=App, _, Sub) -> > Op1 = expr(Op0, value, Sub), > As1 = expr_list(As0, value, Sub), > case Op1 of > #c_var{} -> > App#c_apply{op=Op1,args=As1}; > _ -> > add_warning(App, invalid_call), > ... > > indicating that it's not prepared to handle apply forms with > anything but plain variables in the function position. This > surprised me since: > > 1. I'm generating the above code using the cerl module's constructor > functions which do not mention this restriction, and > 2. the module so constructed passes core_lint:module/1, and > 3. core_pp:format/1 is also happy with it, and > 4. the Core Erlang language specification document doesn't > restrict apply's function position beyond the general class > of expressions. > > So is this restriction deliberate or unintentional? > > For now I work around it by wrapping the apply with a 'let' > binding the function position expression to a temporary. > > /Mikael > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From son@REDACTED Fri Jul 14 16:47:07 2017 From: son@REDACTED (Son Tran-Nguyen) Date: Fri, 14 Jul 2017 09:47:07 -0500 Subject: [erlang-questions] How to implement the A Star find path algorithm using NIF? In-Reply-To: References: <1021d0a4.ce48.15d2d44c7d7.Coremail.cloudzen@163.com> <2B04763C-2822-419C-A7EB-FFAFD721C1E9@gmail.com> <4871f71b.27.15d2d74c56b.Coremail.cloudzen@163.com> Message-ID: Hello, While the choice of C may not be changed, I would suggest writing your algorithm in Rust and use something like https://github.com/hansihe/rustler. It's still NIF, but Rust will handle bad codes for you, making your NIF safe. Just a thought. On Mon, Jul 10, 2017 at 12:32 PM, Dmitry Kolesnikov wrote: > Hello, > > It looks you are trying to implement a hybrid solution a mix up of Erlang > and C code for routing. Unless, I?ve not understood your question. I would > either implement A* purely native or purely in Erlang. In both cases, I > would target a data structure that best suites your problem and > implementation techniques. > > Let?s say, you?ve made decision to implement A* in C then I would design a > NIF API to address problem of A* search rather then memory management. In > this case the updateBlock routine becomes internal for your C code. > > BTW, Have you consider to use Cpp and NIFpp wrapper for Erlang to > integrate existed A* algorithms ? > > Best Regards, > Dmitry > > > On 10 Jul 2017, at 20.03, skyman wrote: > > Hi Dmitry, > > Thanks for your reply. > The map of our game is large(1000 * 1000 grids). If I use NIF to implement > the A Star find path in C, can I allocate the map grid array(1000 * 1000) > in C, and when map blocks changed, Erlang calls 'updateBlock' NIF to update > the grid state in grid array in C? > > Thanks! > > > > > At 2017-07-11 00:33:34, "Dmitry Kolesnikov" > wrote: > > Hello, > > On 10 Jul 2017, at 19.11, skyman wrote: > > Hi everybody, > > Our game is using A Star algorithm to find path. For performance I want > to write it in C language, and Erlang calls it by NIF. I don't know whether > the map data is maintained in C or in Erlang. Can anyone tell me? > > > Map is native data structure. However, you need to use enif interface to > interact with it. > http://erlang.org/doc/man/erl_nif.html#enif_get_map_value > > In addition, is there any better solution than NIF? > > > I?ve used to solve a ?routing? issues on pure Erlang using ETS, lists, > etc. However, this mainly depends on your traffic, latency and size of > routing tables. It is hard to give a straight forward answer not knowing > this figures. > > > > Thanks very much! > > > Best Regards, > Dmitry > > > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gareth.adams@REDACTED Fri Jul 14 18:45:28 2017 From: gareth.adams@REDACTED (Gareth Adams) Date: Fri, 14 Jul 2017 16:45:28 +0000 Subject: [erlang-questions] EUnit quirks Message-ID: Hi, I've been writing some eunit tests using fixtures (http://erlang.org/doc/apps/eunit/chapter.html#Fixtures) and have noticed a couple of quirks. 1. If the setup fails for some reason cleanup is not called. This can be an issue if you're mecking things as the don't get unmecked so the next test setup fails etc. I find myself lost in a cascade of failures, not knowing which tests are really failing. 2. If something fails in the test itself that's not part of an assert, eunit cancels the tests and they are not run. Although this is reported in the console, if you have a lot of tests with debug statements this can be lost. The only thing that indicates that they've not been run is the number of tests decreases, which au not be noticed. Has anyone else had these issues? If so, how did you handle them? Thanks Gareth -------------- next part -------------- An HTML attachment was scrubbed... URL: From fritchie@REDACTED Fri Jul 14 23:38:18 2017 From: fritchie@REDACTED (Scott Lystig Fritchie) Date: Fri, 14 Jul 2017 17:38:18 -0400 Subject: [erlang-questions] ICFP Erlang Workshop 2017 accepted papers and keynote speaker Message-ID: Hi, everyone. Workshop co-chair Natalia Cechina and I are very happy to announce the accepted papers for the 2017 ICFP's Erlang Workshop. The titles and abstracts are available at http://icfp17.sigplan.org/track/erlang-2017-papers#event-overview. We are also looking forward to our keynote speaker, Martin Sumner. His talk is still in the planning stages, but he expects to speak about the gradual adoption of Erlang into the U.K.?s National Health Service. This year's Erlang Workshop is a hosted by the ACM's ICFP conference. It's being held this year at the Maths Institute in Oxford, United Kingdom on 08 September. More information about the venue, registration, and transportation can be found at http://icfp17.sigplan.org/home. BEAM language fans of all stripes and kinds, please join us if you can! -Scott Titles and authors: * Construction and Formal Verification of a Fault-Tolerant Distributed Mutual Exclusion Algorithm - Evgeniy Shishikin * Distributed Memory Architecture for High-Level Synthesis of Embedded Controllers from Erlang - Kagumi Azuma, Nagisa Ishiura, Nobuaki Yoshida, Hiroyuki Kanbara * Keynote speaker: Martin Sumner * Structuring Erlang BEAM control flow - D?niel Luk?cs, Melinda Toth * The Shared-Memory Interferences of Erlang/OTP Built-ins - Stavros Aronis, Kostis Sagonas * Towards Change-driven Testing - Vikt?ria F?rd?s, Istv?n Boz?, Melinda Toth * Towards an Isabelle/HOL Formalisation of Core Erlang - Joseph Richard Harrison * eAOP - An Aspect Oriented Programming Framework for Erlang - Ian Cassar, Adrian Francalanza, Luca Aceto, Anna Ingolfsdottir -------------- next part -------------- An HTML attachment was scrubbed... URL: From gattushivakrishna@REDACTED Sat Jul 15 10:51:05 2017 From: gattushivakrishna@REDACTED (Gattu shiva krishna) Date: Sat, 15 Jul 2017 14:21:05 +0530 Subject: [erlang-questions] Issue with wxDatePickerCtrl in wxerlang Message-ID: <69150a6c-b687-e455-2f3e-dc60af8811d4@utl.in> Hi all, In my application there is a requirement to use the wxDatePickerCtrl wxwidget. When I am using this widget I am unable to get the date which is selected from the datePicker widget. For example: If I select 17th July 2017 in the datePicker Widget, the correct date is displayed in the text area. But when I click anywhere out of the area, it gets updated back to the current date with some garbage value such as *Monday1517October201717***. Is there any solution or work-around for this problem? Regards, Gattu shivakrishna -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenrique85@REDACTED Sat Jul 15 13:32:13 2017 From: jenrique85@REDACTED (Enrique) Date: Sat, 15 Jul 2017 07:32:13 -0400 Subject: [erlang-questions] Erlang Development Job Message-ID: Hi Friends, Does anyone knows where I can find a freelancer online job for development in Erlang? I have been searching but not luck so far. I know this is off topic and I apologise for that but I am between jobs right now. Thank you very much. Enrique From zxq9@REDACTED Sat Jul 15 15:02:34 2017 From: zxq9@REDACTED (zxq9) Date: Sat, 15 Jul 2017 22:02:34 +0900 Subject: [erlang-questions] Issue with wxDatePickerCtrl in wxerlang In-Reply-To: <69150a6c-b687-e455-2f3e-dc60af8811d4@utl.in> References: <69150a6c-b687-e455-2f3e-dc60af8811d4@utl.in> Message-ID: <7323005.FLZ2At8rsy@changa> On 2017?07?15? ??? 14:21:05 Gattu shiva krishna wrote: > Hi all, > > In my application there is a requirement to use the > wxDatePickerCtrl wxwidget. When I am using this widget I am unable to > get the date which is selected from the datePicker widget. > > For example: > > If I select 17th July 2017 in the datePicker Widget, the correct date is > displayed in the text area. But when I click anywhere out of the area, > it gets updated back to the current date with some garbage value such as > *Monday1517October201717***. Is there any solution or work-around for > this problem? It sounds like the value is being updated by some on-click or on-focus action. Are you listening/connected to those anywhere else in your code? If you are, then make sure you're doing getValue/1 on it, and don't call setValue/2 or especially setRange/3 afterward (it is already set, so that would only be a chance to mix something up). I've never seen this problem before, but this is the kind of thing I would check first. -Craig From max.lapshin@REDACTED Sat Jul 15 20:46:40 2017 From: max.lapshin@REDACTED (Max Lapshin) Date: Sat, 15 Jul 2017 21:46:40 +0300 Subject: [erlang-questions] Introspect erlang thread pool Message-ID: Is it possible to introspect erlang thread pool? Which threads are used by which driver? It would be very good to be able to see that thread is used by driver reading file /storage/.... -------------- next part -------------- An HTML attachment was scrubbed... URL: From dszoboszlay@REDACTED Sat Jul 15 21:41:30 2017 From: dszoboszlay@REDACTED (=?UTF-8?Q?D=C3=A1niel_Szoboszlay?=) Date: Sat, 15 Jul 2017 19:41:30 +0000 Subject: [erlang-questions] EUnit quirks In-Reply-To: References: Message-ID: Hi, 1: This specific problem with meck could be worked around by wrapping your fixture into a spawn: meck (by default) unloads mocked modules when the process creating the mocks dies. There's also a more generic approach to this problem. I've seen two different strategies for writing test setup/cleanup code: 1. Setup assumes you start from a known state of the system, and it only has to change things that your test needs in addition to that known initial state. It's the cleanup's responsibility to return to the known state by undoing whatever the setup and the actual test could have changed. 2. Setup doesn't assume anything about the initial state of the system: it has the responsibility of getting it from an arbitrary state to a known state that is suitable for running the test. Cleanup isn't really needed in this model: the next test's setup has to deal with whatever state you leave behind your test. The second strategy is usually more robust, because it is very easy to accidentally start testing when your system is not in it's assumed initial state (at least on your own machine during development). On the other hand, writing setup code that can take you from literally any (possibly broken) state of the system to a known good start state is very hard. But in case of this particular problem it's easy: just call meck:unload() from the setup function as the first thing. 2: Do you have a minimal example showing this behaviour? I tried to reproduce, but at least for me eunit:test/1 does correctly report a test failed outside of an assert as a failure too, and the return value reveals that there was a problem as well. Regards, Daniel On Fri, 14 Jul 2017 at 19:16 Gareth Adams wrote: > Hi, > > I've been writing some eunit tests using fixtures ( > http://erlang.org/doc/apps/eunit/chapter.html#Fixtures) and have noticed > a couple of quirks. > > 1. If the setup fails for some reason cleanup is not called. This can be > an issue if you're mecking things as the don't get unmecked so the next > test setup fails etc. I find myself lost in a cascade of failures, not > knowing which tests are really failing. > > 2. If something fails in the test itself that's not part of an assert, > eunit cancels the tests and they are not run. Although this is reported in > the console, if you have a lot of tests with debug statements this can be > lost. The only thing that indicates that they've not been run is the number > of tests decreases, which au not be noticed. > > Has anyone else had these issues? If so, how did you handle them? > > Thanks > > Gareth > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dszoboszlay@REDACTED Sat Jul 15 22:03:23 2017 From: dszoboszlay@REDACTED (=?UTF-8?Q?D=C3=A1niel_Szoboszlay?=) Date: Sat, 15 Jul 2017 20:03:23 +0000 Subject: [erlang-questions] Erlang VM hanging on node death In-Reply-To: References: Message-ID: Hi, It's just a guess, but maybe the rex processes (the servers accepting rpc calls) get blocked for a long time or get into some deadlock situation following the node crash. This would explain why can't you open a new remote shell: that request too goes via rpc. Try using spawn/4 to start a process on one of the inaccessible nodes or do raw gen_server:call-s using {Name, Node}, because these requests don't have to go through the rex server. Maybe you can debug the problem with these tools. Or, if these techniques would not work, you can be sure that the problem is somewhere deep within erts... Cheers, Daniel On Thu, 13 Jul 2017 at 21:43 Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > Very little to go by. > > My recommendation would be to analyze bottom up through the layers if > possible. Telemetry of IO is useful. The Erlang VM tracks this. Telemetry > of port and process count as well. A sharp drop in CPU load would suggest > processes are blocked on something and waiting for stuff to happen. By > working from the network and up, you can often gain valuable information > which can be used to rule out hypothesis underway. > > What does your logger say about the situation? Anything odd in those logs? > Do you run with system_monitor enabled and does it mention something? Crash > logs? Do you run with exometer_core or something such in the cluster (you > should! establish a baseline of typical operation so you know when things > look weird. You really want measurement on the critical paths, at least > sampling. Otherwise you have no chance at scaling the load over time). What > does the kernel say about TCP send queues on the distribution channels? Are > the TCP windows there closed or open? > > The usual way is to form some kind of hypothesis. Then devise a method to > either confirm or reject the hypothesis. Then form a new one and so on. > Write down everything you find in a document which is shared among > investigators (Git or Google Docs, etc). Track knowledge. One thing which > is very important to look out for are assumptions. If you have an > assumption, you should figure out a way to determine if it is true or not. > You are most often lead astray by an incorrect assumption somewhere in the > chain of events. And this has you hunting for a problem in a corner of the > system where no problems occur. > > Other haphazard list of stuff: > > - any nasty NIFs? > - dTrace on the boxes? (Godsend when things go wrong) > - Consider establishing an Erlang shell early if it is a resource problem. > Then one is handy when things start going wrong. > - Can you provoke the error in a smaller test cluster? Possibly be > artificially resource constraining its network devices as well? > - If you can't create a shell, something rather central could be hosed. > Try figuring out if you ran out of resources etc. > - A slow disk coupled with synchronous calls can easily block a machine > - Excessive debug logging too, but that would max out the CPU load > - The problem might not even be in Erlang. Everything from faulty > hardware, faulty kernel, bad cloud provider, to Elixir or LFE might be the > culprit. Narrowing down the list of likely candidates is important. > > > > > On Thu, Jul 13, 2017 at 7:58 PM Juan Jose Comellas > wrote: > >> Steve, is it possible that the processes were trying to contact other >> processes on the node that went down and were blocking in responses from >> them? If so, do you have timeouts in the calls you make to those processes. >> Also, are you referencing the remote processes in the node that went down >> by pid or by global name? >> >> As Lukas said, it's difficult to know what happened without more >> information, but the answers to the questions above might shed some light >> on the cause(s) of the problem. >> >> On Thu, Jul 13, 2017 at 2:26 PM, Steve Cohen >> wrote: >> >>> Lukas, >>> The second situation is more representative of what happened; CPU >>> quickly trended towards zero, and the VMs were unresponsive. The situation >>> was stable, and didn't generate an erl_crash.dump or a core dump. Next time >>> this happens, we'll try to trigger one. >>> >>> Since we couldn't get into the VMs, all we have to go on is telemetry, >>> which isn't as accurate as being in the remote console. If it helps, I'd be >>> glad to share our telemetry data. The entire cluster immediately >>> experienced a drop in CPU. It was quite strange. >>> >>> Agreed about the remote shell, I guess without a dump, we're stuck. >>> >>> >>> On Thu, Jul 13, 2017 at 12:12 AM, Lukas Larsson >>> wrote: >>> >>>> Hello Steve, >>>> >>>> On Mon, Jul 10, 2017 at 4:14 PM, Steve Cohen >>>> wrote: >>>> >>>>> Now, when one of our guild servers dies, as expected it generates a >>>>> large number of DOWN messages to the sessions cluster. These messages bog >>>>> down the sessions servers (obviously) while they process them, but when >>>>> they're done processing, distribution appears to be completely broken. >>>>> >>>>> >>>> On Thu, Jul 13, 2017 at 1:10 AM, Steve Cohen >>>> wrote: >>>> >>>>> Here's the sequence of events: >>>>> >>>> 1. One of our machines was inadvertently shut off, killing all of the >>>>> processes on it >>>>> 2. We immediately saw a drop in CPU across the board on the sessions >>>>> cluster. CPU on the sessions cluster eventually went to zero. >>>>> 3. We were completely unable to use remote console on any of the >>>>> machines in the cluster, and they all needed to be restarted. >>>>> >>>> >>>> The two scenarios you are describing seem to contradict each other? >>>> First you talk about the sessions servers being bogged down, and then that >>>> the CPU of the sessions cluster went to almost zero? What is it that I'm >>>> missing? >>>> >>>> Did you gather any port mortem dumps from these machines? i.e. a >>>> erl_crash.dump or a core dump? >>>> >>>> Also you have forgotten to mention what version of Erlang/OTP that you >>>> are using. >>>> >>>> >>>>> So, to answer your question, we don't know how long it took for down >>>>> messages to be processed, since we didn't have visibility at the time. We >>>>> suspected a problem with the net_ticktime, but what's confusing to us is >>>>> that the host that went down went down hard, so the DOWN events should have >>>>> been created on the other nodes, not sent across distribution (correct me >>>>> if I'm wrong here). >>>>> >>>> >>>> When a TCP connection used for the erlang distribution is terminated, >>>> all the down messages are (as you say) generated locally. >>>> >>>> >>>>> Also, my intuition is that processing DOWN messages would cause CPU >>>>> usage on the cluster to go up, but we saw the exact opposite. >>>>> >>>>> >>>> With the poweroff of the machine, are you sure that the TCP layer >>>> caught the shutdown? If it didn't, then the next fail-safe is the >>>> net_ticktime. >>>> >>>> >>>>> Since we couldn't connect to the machines via remote console, we >>>>> couldn't call connect_node. It was my understanding that the connect call >>>>> would happen when the node in question reestablished itself. >>>>> >>>> >>>> Yes, it should re-connect when needed. It is quite strange that you >>>> couldn't connect via remote shell. A crash dump or core dump would really >>>> help to understand what is going on. >>>> >>>> >>>>> >>>>> >>>>> On Tue, Jul 11, 2017 at 8:34 PM, Juan Jose Comellas < >>>>> juanjo@REDACTED> wrote: >>>>> >>>>>> How long does it take for all the DOWN messages to be sent/processed? >>>>>> >>>>>> These messages might not be allowing the net tick messages (see >>>>>> net_ticktime in http://erlang.org/doc/man/kernel_app.html) to be >>>>>> responded in time. If this happens, the node that isn't able to respond >>>>>> before the net_ticktime expires will be assumed to be disconnected. >>>>>> >>>>>> What happens if after processing all the DOWN messages you issue a >>>>>> call to net_kernel:connect_node/1 for each of the nodes that seems >>>>>> to be down? >>>>>> >>>>>> On Mon, Jul 10, 2017 at 4:14 PM, Steve Cohen >>>>>> wrote: >>>>>> >>>>>>> Hi all, >>>>>>> >>>>>>> We have 12 nodes in a our guilds cluster, and on each, 500,000 >>>>>>> processes. We have another cluster that has 15 nodes with roughly four >>>>>>> million processes on it, called sessions. Both clusters are in the same >>>>>>> erlang distribution since our guilds monitor sessions and vice-versa. >>>>>>> >>>>>>> Now, when one of our guild servers dies, as expected it generates a >>>>>>> large number of DOWN messages to the sessions cluster. These messages bog >>>>>>> down the sessions servers (obviously) while they process them, but when >>>>>>> they're done processing, distribution appears to be completely broken. >>>>>>> >>>>>>> By broken, I mean that the nodes are disconnected from one another, >>>>>>> they're not exchanging messages, CPU usage was 0 and we couldn't even >>>>>>> launch the remote console. >>>>>>> >>>>>>> I can't imagine this is expected behavior, and was wondering if >>>>>>> someone can shed some light on it. >>>>>>> We're open to the idea that we're doing something very, very wrong. >>>>>>> >>>>>>> >>>>>>> Thanks in advance for the help >>>>>>> >>>>>>> -- >>>>>>> Steve Cohen >>>>>>> >>>>>>> _______________________________________________ >>>>>>> erlang-questions mailing list >>>>>>> erlang-questions@REDACTED >>>>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>>>> >>>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> -Steve >>>>> >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>> >>>>> >>>> >>> >>> >>> -- >>> -Steve >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carlsson.richard@REDACTED Sun Jul 16 11:50:56 2017 From: carlsson.richard@REDACTED (Richard Carlsson) Date: Sun, 16 Jul 2017 11:50:56 +0200 Subject: [erlang-questions] EUnit quirks In-Reply-To: References: Message-ID: 1: A setup function is assumed to either succeed, with a possibly modified world as result, or fail, with an unchanged world as result. If you need to make multiple changes, the idea is that you either write separate setup/cleanup functions for each change and nest them to create a complete setup, or you write a single setup function that does its own internal catching of errors and partial cleanup. 2. All exceptions in a test case should be handled the same by eunit. Asserts are just one way of throwing an exception. Do you have an example to demonstrate what you are seeing? /Richard 2017-07-14 18:45 GMT+02:00 Gareth Adams : > Hi, > > I've been writing some eunit tests using fixtures ( > http://erlang.org/doc/apps/eunit/chapter.html#Fixtures) and have noticed > a couple of quirks. > > 1. If the setup fails for some reason cleanup is not called. This can be > an issue if you're mecking things as the don't get unmecked so the next > test setup fails etc. I find myself lost in a cascade of failures, not > knowing which tests are really failing. > > 2. If something fails in the test itself that's not part of an assert, > eunit cancels the tests and they are not run. Although this is reported in > the console, if you have a lot of tests with debug statements this can be > lost. The only thing that indicates that they've not been run is the number > of tests decreases, which au not be noticed. > > Has anyone else had these issues? If so, how did you handle them? > > Thanks > > Gareth > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gootik_2003@REDACTED Sun Jul 16 12:07:16 2017 From: gootik_2003@REDACTED (Sasan Hezarkhani) Date: Sun, 16 Jul 2017 10:07:16 +0000 Subject: [erlang-questions] This week in Erlang Message-ID: Hi there, I put together a sum up of what happened in Erlang world last week: https://medium.com/@gootik/this-week-in-erlang-jul-9-d670edddb910 I'm going to continue doing this every week, hope people find it useful. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdl.web@REDACTED Sun Jul 16 12:24:51 2017 From: sdl.web@REDACTED (Leo Liu) Date: Sun, 16 Jul 2017 18:24:51 +0800 Subject: [erlang-questions] This week in Erlang References: Message-ID: On 2017-07-16 10:07 +0000, Sasan Hezarkhani wrote: > I'm going to continue doing this every week, hope people find it > useful. Thank you for the work ;) Leo From gareth.adams@REDACTED Sun Jul 16 13:12:51 2017 From: gareth.adams@REDACTED (Gareth Adams) Date: Sun, 16 Jul 2017 11:12:51 +0000 Subject: [erlang-questions] EUnit quirks In-Reply-To: References: , Message-ID: Hi, This reply is to both you, Richard, and Daniel (didn?t want to pollute the list with two answers). Regarding 1: I?d worked out that I could wrap up the setup so it doesn?t blow and cleans up after itself if there?s an error, I?d just hoped that eunit could have done that for me by always running the cleanup function. I like the idea of spawning the tests ? I?ll try that in work tomorrow and see what happens. I suppose the setup making sure that the system is in a known state before it starts is not a bad idea either but it may lead to lazy tests where no one cleans up after themselves. Regarding 2: I?ve written a quick test where the first two tests are not run because I?ve called an unknown function but the third test is run. As I say, the console does report the failing test but when we?ve got ~1000 tests that often produce debug printouts this gets lost. I?ve noticed the ?One or more tests were cancelled? ? I don?t recall seeing that in work, I?ll check. However, we use intellij in work which doesn?t display the console results in the test runner by default. -module(aborted). -include_lib("eunit/include/eunit.hrl"). aborted_test_() -> { foreach, fun setup/0, fun cleanup/1, [ fun test1/1, fun test2/1 ] }. setup() -> state. cleanup(_State) -> ok. test1(State) -> call:unknown(State), [ {"Passing test", ?_assertEqual(state, State)}, {"First Failing test", ?_assertEqual(not_state, State)} ]. test2(State) -> [ {"Second Failing test", ?_assertEqual(really_not_state, State)} ]. Sent from Mail for Windows 10 From: Richard Carlsson Sent: 16 July 2017 10:51 To: Gareth Adams Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] EUnit quirks 1: A setup function is assumed to either succeed, with a possibly modified world as result, or fail, with an unchanged world as result. If you need to make multiple changes, the idea is that you either write separate setup/cleanup functions for each change and nest them to create a complete setup, or you write a single setup function that does its own internal catching of errors and partial cleanup. 2. All exceptions in a test case should be handled the same by eunit. Asserts are just one way of throwing an exception. Do you have an example to demonstrate what you are seeing? /Richard 2017-07-14 18:45 GMT+02:00 Gareth Adams >: Hi, I've been writing some eunit tests using fixtures (http://erlang.org/doc/apps/eunit/chapter.html#Fixtures) and have noticed a couple of quirks. 1. If the setup fails for some reason cleanup is not called. This can be an issue if you're mecking things as the don't get unmecked so the next test setup fails etc. I find myself lost in a cascade of failures, not knowing which tests are really failing. 2. If something fails in the test itself that's not part of an assert, eunit cancels the tests and they are not run. Although this is reported in the console, if you have a lot of tests with debug statements this can be lost. The only thing that indicates that they've not been run is the number of tests decreases, which au not be noticed. Has anyone else had these issues? If so, how did you handle them? Thanks Gareth _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From albin.stigo@REDACTED Sun Jul 16 18:28:19 2017 From: albin.stigo@REDACTED (=?UTF-8?B?QWxiaW4gU3RpZ8O2?=) Date: Sun, 16 Jul 2017 18:28:19 +0200 Subject: [erlang-questions] How does Erlang kill port processes? Message-ID: Hello, I have a program that relies on C API calls to the Linux bluetooth stack (bluez) so I wrote a port program for that... There seems to be a bug in the version of the bluez stack I'm using that requires programs to clean up after themselves or the program will fail on the next execution (I guess some garbage state in driver / hardware). I have tried to catch SIGPIPE/SIGTERM and check for EPIPE in my port but it doesn't seem to work. How does Erlang kill ports? SIGKILL? Any ideas on how to clean up on exit..? I realise this is very fragile but as of now I need to work around this bug... --Albin From ali.sabil@REDACTED Sun Jul 16 19:39:43 2017 From: ali.sabil@REDACTED (Ali Sabil) Date: Sun, 16 Jul 2017 19:39:43 +0200 Subject: [erlang-questions] How does Erlang kill port processes? In-Reply-To: References: Message-ID: Hi Albin, The Erlang runtime doesn't actually kill the port, but just closes the pipe. You port should then detect an end-of-file on its input pipe. Best, Ali On Sun, Jul 16, 2017 at 6:28 PM, Albin Stig? wrote: > Hello, > > I have a program that relies on C API calls to the Linux bluetooth > stack (bluez) so I wrote a port program for that... > > There seems to be a bug in the version of the bluez stack I'm using > that requires programs to clean up after themselves or the program > will fail on the next execution (I guess some garbage state in driver > / hardware). > > I have tried to catch SIGPIPE/SIGTERM and check for EPIPE in my port > but it doesn't seem to work. How does Erlang kill ports? SIGKILL? > > Any ideas on how to clean up on exit..? I realise this is very fragile > but as of now I need to work around this bug... > > > --Albin > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From albin.stigo@REDACTED Sun Jul 16 22:31:50 2017 From: albin.stigo@REDACTED (=?UTF-8?B?QWxiaW4gU3RpZ8O2?=) Date: Sun, 16 Jul 2017 22:31:50 +0200 Subject: [erlang-questions] How does Erlang kill port processes? In-Reply-To: References: Message-ID: Hi, Ah ok that should solve it! I read from a Bluetooth socket and wrote to stdout using blocking io and wasn't reading from stdin at all... That's why I got confused about how Erlang killed the process. Changed to using poll and check for POLLHUP on stdin. Thanks, Albin On Jul 16, 2017 19:40, "Ali Sabil" wrote: Hi Albin, The Erlang runtime doesn't actually kill the port, but just closes the pipe. You port should then detect an end-of-file on its input pipe. Best, Ali On Sun, Jul 16, 2017 at 6:28 PM, Albin Stig? wrote: > Hello, > > I have a program that relies on C API calls to the Linux bluetooth > stack (bluez) so I wrote a port program for that... > > There seems to be a bug in the version of the bluez stack I'm using > that requires programs to clean up after themselves or the program > will fail on the next execution (I guess some garbage state in driver > / hardware). > > I have tried to catch SIGPIPE/SIGTERM and check for EPIPE in my port > but it doesn't seem to work. How does Erlang kill ports? SIGKILL? > > Any ideas on how to clean up on exit..? I realise this is very fragile > but as of now I need to work around this bug... > > > --Albin > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gattushivakrishna@REDACTED Tue Jul 18 06:32:39 2017 From: gattushivakrishna@REDACTED (Gattu shiva krishna) Date: Tue, 18 Jul 2017 10:02:39 +0530 Subject: [erlang-questions] Issue with wxDatePickerCtrl in wxerlang Message-ID: <646e18ad-ab4c-7a88-97f5-4f4cf01c47e6@utl.in> Hi all, In my application there is a requirement to use the wxDatePickerCtrl wxwidget (wx version 1.8). When I am using this widget I am unable to get the date which is selected from the datePicker widget. For example: -> If I select 19th July 2017 in the datePicker Widget, the correct date is displayed in the text area. But when I click anywhere out of the area, it gets updated back to the current date with some garbage value such as *Monday1519October201717***. -> I am listening to "date_changed" event and i am using only getValue/1 but still i am getting the same problem and also i am getting a warning like this **(Erlang:19595): Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text(). Is there any solution or work-around for this problem? Regards, Gattu shivakrishna -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.arnon@REDACTED Tue Jul 18 13:29:20 2017 From: alex.arnon@REDACTED (Alex Arnon) Date: Tue, 18 Jul 2017 14:29:20 +0300 Subject: [erlang-questions] This week in Erlang In-Reply-To: References: Message-ID: This is great, thank you! On Sun, Jul 16, 2017 at 1:24 PM, Leo Liu wrote: > On 2017-07-16 10:07 +0000, Sasan Hezarkhani wrote: > > I'm going to continue doing this every week, hope people find it > > useful. > > Thank you for the work ;) > > Leo > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From icfp.publicity@REDACTED Tue Jul 18 23:33:52 2017 From: icfp.publicity@REDACTED (Lindsey Kuper) Date: Tue, 18 Jul 2017 14:33:52 -0700 Subject: [erlang-questions] Call for Participation: ICFP 2017 Message-ID: <596e7ec0b40b8_602d3fdee4455be868636@landin.local.mail> [ Early registration ends 4 August. ] ===================================================================== Call for Participation ICFP 2017 22nd ACM SIGPLAN International Conference on Functional Programming and affiliated events September 3 - September 9, 2017 Oxford, UK http://icfp17.sigplan.org/ ===================================================================== ICFP provides a forum for researchers and developers to hear about the latest work on the design, implementations, principles, and uses of functional programming. The conference covers the entire spectrum of work, from practice to theory, including its peripheries. A full week dedicated to functional programming: ICFP, 2 co-hosted conferences, 1 co-hosted symposium, workshops, tutorials, programming contest results, student research competition, and mentoring workshop * Overview and affiliated events: http://icfp17.sigplan.org/home * Program: http://icfp17.sigplan.org/program/program-icfp-2017 * Accepted papers: http://icfp17.sigplan.org/track/icfp-2017-papers * Registration is available via: https://regmaster4.com/2017conf/ICFP17/register.php Early registration is due 4 August, 2016. * Programming contest, 4-7 August, 2016: http://2017.icfpcontest.org * Student Research Competition: http://icfp17.sigplan.org/track/icfp-2017-Student-Research-Competition * Follow @icfp_conference on twitter for the latest news: http://twitter.com/icfp_conference There are several events affiliated with ICFP: Sunday, September 3 Workshop on Higher-order Programming with Effects Workshop on Type-Driven Development Scheme and Functional Programming Workshop Programming Languages Mentoring Workshop ICFP Tutorials Monday, September 4 ? Wednesday, September 6 ICFP FSCD - Days 1-3 Thursday, September 7 Haskell Symposium ? Day 1 ML Family Workshop Workshop on Functional High-Performance Computing Commercial Users of Functional Programming ? Day 1 FSCD - Day 4 Friday, September 8 Haskell Symposium ? Day 2 OCaml Workshop Erlang Workshop Commercial Users of Functional Programming ? Day 2 Saturday, September 9 Commercial Users of Functional Programming ? Day 3 Haskell Implementors Workshop Functional Art, Music, Modeling and Design Conference Organizers: General Chair: Jeremy Gibbons (University of Oxford, UK) Program Chair: Mark Jones (Portland State University, USA) Artifact Evaluation Co-Chair: Matthew Flatt (University of Utah, USA) Artifact Evaluation Co-Chair: Ryan R. Newton (Indiana University, USA) Industrial Relations Chair: Ryan Trinkle (Obsidian Systems LLC, USA) PLMW Co-Chair: Neelakantan R. Krishnawami (University of Cambridge, UK) PLMW Co-Chair: Dan Licata (Wesleyan University, USA) PLMW Co-Chair: Brigitte Pientka (McGill University, Canada) Programming Contest Organiser: Sam Lindley (University of Edinburgh, UK) Publicity and Web Chair: Lindsey Kuper (Intel Labs, USA) Student Research Competition Chair: Ilya Sergey (University College London, UK) Student Volunteer Co-Captain: Yosuke Fukuda (Kyoto University, Japan) Student Volunteer Co-Captain: Yuki Nishida (Kyoto University, Japan) Student Volunteer Co-Captain: Jakub Zalewski (University of Edinburgh, UK) Video Chair: Jose Calderon (Galois, Inc., USA) Workshops Co-Chair: Andres L?h (Well-Typed LLP, UK) Workshops Co-Chair: David Christiansen (Indiana University, USA) Sponsors and industrial partners: Platinum partners Ahrefs Jane Street Capital Gold partners Bloomberg X Silver partners Galois Oracle Bronze partners Obsidian Systems Portland State University Well-Typed From erlang@REDACTED Wed Jul 19 12:45:29 2017 From: erlang@REDACTED (Joe Armstrong) Date: Wed, 19 Jul 2017 12:45:29 +0200 Subject: [erlang-questions] [ANN] Sonic Pi 3.0 released Message-ID: Sonic Pi V3 now includes a complete Erlang distribution. Sonic Pi is a complete programmable music making machine, for teaching kids to program and for music experiments. The Erlang is well hidden away - but it's there together with a complete Ruby and Supercollider (also hidden) So far I've only tested this on my Mac - but I think Erlang is also included in the rasberry Pi, linux and windows distributions (or at least will be) This is actually an amazing bit of engineering - in a single desktop app Sonic Pi includes complete stripped down versions of Ruby and Erlang and the Supercollider. All these are isolated components talking together through OSC over UDP. (See http://joearms.github.io/2016/01/28/A-Badass-Way-To-Connect-Programs-Together.html - for details of OSC) Sonic Pi is programmed in Ruby+Erlang+C++ + Supercollider language and uses QT for the interface. This is how systems should be built. Sam has done a fantastic job job here - as a side effect of this Erlang will be in the standard Rasberry Pi distro - whether it stays there is up to YOU - Sam has done the ground work - this actually opens the SonicPi infrastructure to Erlang and Elixir Programmers So what are you waiting for? - Go write a drum machine in Erlang or an arpeggiator or a harmonizer - or write it in Elixir if that is your thing. Have fun /Joe From albin.stigo@REDACTED Wed Jul 19 13:40:22 2017 From: albin.stigo@REDACTED (=?UTF-8?B?QWxiaW4gU3RpZ8O2?=) Date: Wed, 19 Jul 2017 13:40:22 +0200 Subject: [erlang-questions] [ANN] Sonic Pi 3.0 released In-Reply-To: References: Message-ID: Out of curiosity, what is Erlang used for in Sonic Pi? Music programming in Erlang should be pretty great considering a lot of it is message based... MIDI, OSC etc. --Albin On Wed, Jul 19, 2017 at 12:45 PM, Joe Armstrong wrote: > Sonic Pi V3 now includes a complete Erlang distribution. > > Sonic Pi is a complete programmable music making machine, > for teaching kids to program and for music experiments. > > The Erlang is well hidden away - but it's there > together with a complete Ruby and Supercollider (also hidden) > > So far I've only tested this on my Mac - but I think Erlang > is also included in the rasberry Pi, linux and windows distributions > (or at least will be) > > This is actually an amazing bit of engineering - in a single desktop app > Sonic Pi includes complete stripped down versions of Ruby and Erlang > and the Supercollider. All these are isolated components talking > together through OSC over UDP. > > (See http://joearms.github.io/2016/01/28/A-Badass-Way-To-Connect-Programs-Together.html > - for details of OSC) > > Sonic Pi is programmed in Ruby+Erlang+C++ + Supercollider language > and uses QT for the interface. > > This is how systems should be built. > > Sam has done a fantastic job job here - as a side effect of this > Erlang will be in the standard Rasberry Pi distro - whether it stays there > is up to YOU - Sam has done the ground work - this actually opens the > SonicPi infrastructure to Erlang and Elixir Programmers > > So what are you waiting for? - Go write a drum machine in Erlang > or an arpeggiator or a harmonizer - or write it in Elixir if that is > your thing. > > Have fun > > /Joe > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From erlang@REDACTED Wed Jul 19 15:31:54 2017 From: erlang@REDACTED (Joe Armstrong) Date: Wed, 19 Jul 2017 15:31:54 +0200 Subject: [erlang-questions] [ANN] Sonic Pi 3.0 released In-Reply-To: References: Message-ID: On Wed, Jul 19, 2017 at 1:40 PM, Albin Stig? wrote: > Out of curiosity, what is Erlang used for in Sonic Pi? The note scheduler - basically Erlang does "at do " This is *trivial* in Erlang -- but a pain in Ruby - so Erlang is messing around in the background scheduling message sending. /Joe > > Music programming in Erlang should be pretty great considering a lot > of it is message based... MIDI, OSC etc. > > > --Albin > > On Wed, Jul 19, 2017 at 12:45 PM, Joe Armstrong wrote: >> Sonic Pi V3 now includes a complete Erlang distribution. >> >> Sonic Pi is a complete programmable music making machine, >> for teaching kids to program and for music experiments. >> >> The Erlang is well hidden away - but it's there >> together with a complete Ruby and Supercollider (also hidden) >> >> So far I've only tested this on my Mac - but I think Erlang >> is also included in the rasberry Pi, linux and windows distributions >> (or at least will be) >> >> This is actually an amazing bit of engineering - in a single desktop app >> Sonic Pi includes complete stripped down versions of Ruby and Erlang >> and the Supercollider. All these are isolated components talking >> together through OSC over UDP. >> >> (See http://joearms.github.io/2016/01/28/A-Badass-Way-To-Connect-Programs-Together.html >> - for details of OSC) >> >> Sonic Pi is programmed in Ruby+Erlang+C++ + Supercollider language >> and uses QT for the interface. >> >> This is how systems should be built. >> >> Sam has done a fantastic job job here - as a side effect of this >> Erlang will be in the standard Rasberry Pi distro - whether it stays there >> is up to YOU - Sam has done the ground work - this actually opens the >> SonicPi infrastructure to Erlang and Elixir Programmers >> >> So what are you waiting for? - Go write a drum machine in Erlang >> or an arpeggiator or a harmonizer - or write it in Elixir if that is >> your thing. >> >> Have fun >> >> /Joe >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From fhunleth@REDACTED Wed Jul 19 16:03:27 2017 From: fhunleth@REDACTED (Frank Hunleth) Date: Wed, 19 Jul 2017 10:03:27 -0400 Subject: [erlang-questions] ssh-agent support for ssh:connect/4? Message-ID: I have a client application that uses ssh:connect to connect to a server and do a few tasks. I'm using public key authentication, but the private key is password protected. I'm currently using the rsa_pass_phrase option but passing the password around in the clear is not desirable at all. There's also a strong desire to keep the private keys password protected. I was wondering how others handled this. Using ssh-agent is certainly an option for me if that can be integrated into the Erlang ssh client somehow. If other options exist, that would be great too. Thanks, Frank From Oliver.Korpilla@REDACTED Wed Jul 19 16:29:56 2017 From: Oliver.Korpilla@REDACTED (Oliver Korpilla) Date: Wed, 19 Jul 2017 16:29:56 +0200 Subject: [erlang-questions] Registries: How to best work with late-joining nodes? Message-ID: Hello. I have no control when the nodes in my application start up. I have a simple star structure where all worker nodes try to connect to a central node as soon as they come up. They may have to retry until that central node is even available. There is no guarantee that worker nodes start within a certain time frame or even after the central node. My central node does: * Start gproc (with gproc_dist set to all) * Start mnesia * Start further supervisors and workers My worker nodes do: * Connect to central node * Start gproc * Start mnesia * Starts further supervisors and workers >From reading gproc source code I see that gproc uses the list of currently connected nodes for picking the leader. I seem to have occasional races where each of the joining nodes see only the central node and not each other and then proceed to declare themselves leader and not talk to each other at all. But this seems to be only the tip of the iceberg pointing to a deeper problem - that in general nodes joining a cluster late seem to create a lot of process, especially when I cannot guarantee that the center of my star cluster is there first. *** My question is this: Do other registries like syn or gproc/locks_leader better with late-joining nodes? What process registries do you use for such scenarios? *** I love the feature-rich API of gproc, and I already have a lot of code centered around it, so anyone who can point me to do this properly or better - syncing up late nodes - would render me a great service. Building in another registry would require some effort and I would want to make sure this is even required. Thank you and kind regards, Oliver From Oliver.Korpilla@REDACTED Wed Jul 19 16:32:20 2017 From: Oliver.Korpilla@REDACTED (Oliver Korpilla) Date: Wed, 19 Jul 2017 16:32:20 +0200 Subject: [erlang-questions] Registries: How to best work with late-joining nodes? In-Reply-To: References: Message-ID: "that in general nodes joining a cluster late seem to create a lot of process" => "that in general nodes joining a cluster late seem to create a lot of problems" ? Sorry for that. ? Gesendet:?Mittwoch, 19. Juli 2017 um 16:29 Uhr Von:?"Oliver Korpilla" An:?erlang-questions Betreff:?[erlang-questions] Registries: How to best work with late-joining nodes? Hello. I have no control when the nodes in my application start up. I have a simple star structure where all worker nodes try to connect to a central node as soon as they come up. They may have to retry until that central node is even available. There is no guarantee that worker nodes start within a certain time frame or even after the central node. My central node does: * Start gproc (with gproc_dist set to all) * Start mnesia * Start further supervisors and workers My worker nodes do: * Connect to central node * Start gproc * Start mnesia * Starts further supervisors and workers >From reading gproc source code I see that gproc uses the list of currently connected nodes for picking the leader. I seem to have occasional races where each of the joining nodes see only the central node and not each other and then proceed to declare themselves leader and not talk to each other at all. But this seems to be only the tip of the iceberg pointing to a deeper problem - that in general nodes joining a cluster late seem to create a lot of process, especially when I cannot guarantee that the center of my star cluster is there first. *** My question is this: Do other registries like syn or gproc/locks_leader better with late-joining nodes? What process registries do you use for such scenarios? *** I love the feature-rich API of gproc, and I already have a lot of code centered around it, so anyone who can point me to do this properly or better - syncing up late nodes - would render me a great service. Building in another registry would require some effort and I would want to make sure this is even required. Thank you and kind regards, Oliver _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions From soverdor@REDACTED Thu Jul 20 01:39:38 2017 From: soverdor@REDACTED (Sam Overdorf) Date: Wed, 19 Jul 2017 16:39:38 -0700 Subject: [erlang-questions] List of strings problem Message-ID: I have a list of strings I am trying to process with the "|". D = [ "sam1", "sam2" ] [H|T] = D gives me H = "sam1" [H2|T2] = T gives me "s" I was wanting the string "sam2" not the "s". What am I doing wrong? Thanks, Sam Overdorf From vladdu55@REDACTED Thu Jul 20 08:58:42 2017 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Thu, 20 Jul 2017 08:58:42 +0200 Subject: [erlang-questions] List of strings problem In-Reply-To: References: Message-ID: Hi, It works as expected for me. Are you sure that D elements are separated by comma and not by | ? Regards, Vlad On 20 Jul 2017 08:43, "Sam Overdorf" wrote: I have a list of strings I am trying to process with the "|". D = [ "sam1", "sam2" ] [H|T] = D gives me H = "sam1" [H2|T2] = T gives me "s" I was wanting the string "sam2" not the "s". What am I doing wrong? Thanks, Sam Overdorf _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Thu Jul 20 09:00:41 2017 From: eric.pailleau@REDACTED (=?ISO-8859-1?Q?=C9ric_Pailleau?=) Date: Thu, 20 Jul 2017 09:00:41 +0200 Subject: [erlang-questions] List of strings problem In-Reply-To: Message-ID: <6d81bdd0-4a39-4b61-a8c9-46357e92fa76@email.android.com> An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Thu Jul 20 09:38:08 2017 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Thu, 20 Jul 2017 09:38:08 +0200 Subject: [erlang-questions] List of strings problem In-Reply-To: References: <6d81bdd0-4a39-4b61-a8c9-46357e92fa76@email.android.com> Message-ID: Yes, indeed it is the normal behaviour. I suspect you do something like list flatten before so that [H2|T2] = T. is [H2|T2] = [$s,$a,$m,$2] and you got "s". the reason why I told you to do [H2|T2] = [T]. but minimal test is correct like Taras pointed. regards Le 20/07/2017 ? 09:31, Taras Halturin a ?crit : > Just to be sure... > > Erlang/OTP 19 [erts-8.2.1] [source] [64-bit] [smp:4:4] > [async-threads:10] [kernel-poll:false] > > Eshell V8.2.1 (abort with ^G) > 1> D = [ "sam1", "sam2" ]. > ["sam1","sam2"] > 2> [H|T] = D. > ["sam1","sam2"] > 3> [H2|T2] = T. > ["sam2"] > 4> T2. > [] > 5> H2. > "sam2" > 6> > > It works as you expected. > > On Thu, Jul 20, 2017 at 10:00 AM, ?ric Pailleau > > wrote: > > Hi, > T is already sam2. > Strings are list so try [H2|T2]=[T] ... > Regards > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > -- > Best Regards. > Taras Halturin From halturin@REDACTED Thu Jul 20 09:31:14 2017 From: halturin@REDACTED (Taras Halturin) Date: Thu, 20 Jul 2017 10:31:14 +0300 Subject: [erlang-questions] List of strings problem In-Reply-To: <6d81bdd0-4a39-4b61-a8c9-46357e92fa76@email.android.com> References: <6d81bdd0-4a39-4b61-a8c9-46357e92fa76@email.android.com> Message-ID: Just to be sure... Erlang/OTP 19 [erts-8.2.1] [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false] Eshell V8.2.1 (abort with ^G) 1> D = [ "sam1", "sam2" ]. ["sam1","sam2"] 2> [H|T] = D. ["sam1","sam2"] 3> [H2|T2] = T. ["sam2"] 4> T2. [] 5> H2. "sam2" 6> It works as you expected. On Thu, Jul 20, 2017 at 10:00 AM, ?ric Pailleau wrote: > Hi, > T is already sam2. > Strings are list so try [H2|T2]=[T] ... > Regards > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Best Regards. Taras Halturin -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob@REDACTED Thu Jul 20 12:08:37 2017 From: bob@REDACTED (Robert Wilkinson) Date: Thu, 20 Jul 2017 12:08:37 +0200 Subject: [erlang-questions] ssh-agent support for ssh:connect/4? In-Reply-To: References: Message-ID: <20170720100837.GA12065@fourtheye.org> On Wed, Jul 19, 2017 at 10:03:27AM -0400, Frank Hunleth wrote: > I have a client application that uses ssh:connect to connect to a > server and do a few tasks. I'm using public key authentication, but > the private key is password protected. I'm currently using the > rsa_pass_phrase option but passing the password around in the clear is > not desirable at all. There's also a strong desire to keep the private > keys password protected. I was wondering how others handled this. > Using ssh-agent is certainly an option for me if that can be > integrated into the Erlang ssh client somehow. If other options exist, > that would be great too. > > Thanks, > Frank Hi Frank For automation, and where I know that my private key is secure (where secure varies dependent on how concerned I am for the data) I use a key-pair combination with *no password* and then load the private key into ssh-agent, and then I can connect to the machine which has the public key in it's authorized_keys file. However, using ssh-agent would work fine if there were a passphrase but usually it does not matter to me. Note that I did not mention erland here ... Bob -- How many NASA managers does it take to screw in a lightbulb? "That's a known problem... don't worry about it." From ludovic@REDACTED Thu Jul 20 18:49:58 2017 From: ludovic@REDACTED (lud) Date: Thu, 20 Jul 2017 18:49:58 +0200 Subject: [erlang-questions] Process swarm vs Queues Message-ID: <9705d84fceeb90f6378f1ce11b872851@demblans.com> Hi, I would like some advice regarding the design of my system. I have a couple of processes monitoring data endpoints on the internet, and sending events in my system when data changes. Then, I have a swarm of processes dedicated to handle those events. These processes are different, it's not the same code that handles changes for different resources types (comments, feeds, The specific things : * Processes register themselves to an ETS table to tell which resources they monitor. * Processes states are very important and I can't afford to lose them. So the state is saved to disk after every handled event, and retrieved on restart. * Events are quite rare, about 10 per second, whereas I could have 1000 or 10,000 monitored resources. At this point, I was thinking : why use a process for each resource and have so much hibernating processes. Why not just use a job queue with 10 workers, receive an event, load the data from disk, handle the event, save to disk ? It seems correct to me. I started with processes because it feels natural, but now I'm quite lost, I don't need all those idling processes. I feel like I was just thinking OOP (SHAME ! Just kidding ?). How do you choose, why would you choose one of these two designs, or one another ? Thank you for reading Best regards Ludovic From dmkolesnikov@REDACTED Thu Jul 20 19:27:06 2017 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Thu, 20 Jul 2017 20:27:06 +0300 Subject: [erlang-questions] Process swarm vs Queues In-Reply-To: <9705d84fceeb90f6378f1ce11b872851@demblans.com> References: <9705d84fceeb90f6378f1ce11b872851@demblans.com> Message-ID: Hello, Short answer: Process swarm You'll going to implement a task scheduling routines if you choose a queuing approach. A similar task scheduling routines are already implemented by VM. You are not going to implement more efficiently then it is already done. The process pool + queue is an approach to deal with external system. The process per action is a natural approach in the actor systems. The memory overhead is reasonable, hibernate feature helps you to minimize it to few bytes. The CPU overhead to spawn a new process is reasonable as well. You can run millions of process on the node. The process per action helps you with GC, fault tolerance and makes the implementation simple. Best Regards, Dmitry >-|-|-(*> > On 20 Jul 2017, at 19.49, lud wrote: > > Hi, > > I would like some advice regarding the design of my system. > > I have a couple of processes monitoring data endpoints on the internet, and sending events in my system when data changes. > Then, I have a swarm of processes dedicated to handle those events. These processes are different, it's not the same code that handles changes for different resources types (comments, feeds, > > The specific things : > * Processes register themselves to an ETS table to tell which resources they monitor. > * Processes states are very important and I can't afford to lose them. So the state is saved to disk after every handled event, and retrieved on restart. > * Events are quite rare, about 10 per second, whereas I could have 1000 or 10,000 monitored resources. > > At this point, I was thinking : why use a process for each resource and have so much hibernating processes. Why not just use a job queue with 10 workers, receive an event, load the data from disk, handle the event, save to disk ? > > It seems correct to me. I started with processes because it feels natural, but now I'm quite lost, I don't need all those idling processes. I feel like I was just thinking OOP (SHAME ! Just kidding ?). > > How do you choose, why would you choose one of these two designs, or one another ? > > Thank you for reading > > Best regards > > Ludovic > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From soverdor@REDACTED Fri Jul 21 01:57:34 2017 From: soverdor@REDACTED (Sam Overdorf) Date: Thu, 20 Jul 2017 16:57:34 -0700 Subject: [erlang-questions] List of strings problem In-Reply-To: References: <6d81bdd0-4a39-4b61-a8c9-46357e92fa76@email.android.com> Message-ID: Thanks for responding so quickly. I am using Windows7 could this be causing some of my odd behavior? Thanks, Sam On Thu, Jul 20, 2017 at 12:38 AM, PAILLEAU Eric wrote: > Yes, > indeed it is the normal behaviour. > I suspect you do something like list flatten before so that > [H2|T2] = T. > is > [H2|T2] = [$s,$a,$m,$2] and you got "s". > the reason why I told you to do > [H2|T2] = [T]. > > but minimal test is correct like Taras pointed. > > regards > > Le 20/07/2017 ? 09:31, Taras Halturin a ?crit : >> >> Just to be sure... >> >> Erlang/OTP 19 [erts-8.2.1] [source] [64-bit] [smp:4:4] [async-threads:10] >> [kernel-poll:false] >> >> Eshell V8.2.1 (abort with ^G) >> 1> D = [ "sam1", "sam2" ]. >> ["sam1","sam2"] >> 2> [H|T] = D. >> ["sam1","sam2"] >> 3> [H2|T2] = T. >> ["sam2"] >> 4> T2. >> [] >> 5> H2. >> "sam2" >> 6> >> >> It works as you expected. >> >> On Thu, Jul 20, 2017 at 10:00 AM, ?ric Pailleau > > wrote: >> >> Hi, >> T is already sam2. >> Strings are list so try [H2|T2]=[T] ... >> Regards >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> >> >> >> -- >> Best Regards. >> Taras Halturin > > From raimo+erlang-questions@REDACTED Fri Jul 21 08:40:08 2017 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 21 Jul 2017 08:40:08 +0200 Subject: [erlang-questions] List of strings problem In-Reply-To: References: <6d81bdd0-4a39-4b61-a8c9-46357e92fa76@email.android.com> Message-ID: <20170721064008.GA23437@erix.ericsson.se> On Thu, Jul 20, 2017 at 04:57:34PM -0700, Sam Overdorf wrote: > Thanks for responding so quickly. > I am using Windows7 could this be causing some of my odd behavior? > Thanks, > Sam Nope. That should not matter. Please re-do your example and cut-and-paste the result hera again, exactly as Taras did, so there is no room for human error or interpretation... f(). D = [ "sam1", "sam2" ]. [H|T] = D. H. [H2|T2] = T. H2. > > > On Thu, Jul 20, 2017 at 12:38 AM, PAILLEAU Eric > wrote: > > Yes, > > indeed it is the normal behaviour. > > I suspect you do something like list flatten before so that > > [H2|T2] = T. > > is > > [H2|T2] = [$s,$a,$m,$2] and you got "s". > > the reason why I told you to do > > [H2|T2] = [T]. > > > > but minimal test is correct like Taras pointed. > > > > regards > > > > Le 20/07/2017 ? 09:31, Taras Halturin a ?crit : > >> > >> Just to be sure... > >> > >> Erlang/OTP 19 [erts-8.2.1] [source] [64-bit] [smp:4:4] [async-threads:10] > >> [kernel-poll:false] > >> > >> Eshell V8.2.1 (abort with ^G) > >> 1> D = [ "sam1", "sam2" ]. > >> ["sam1","sam2"] > >> 2> [H|T] = D. > >> ["sam1","sam2"] > >> 3> [H2|T2] = T. > >> ["sam2"] > >> 4> T2. > >> [] > >> 5> H2. > >> "sam2" > >> 6> > >> > >> It works as you expected. > >> > >> On Thu, Jul 20, 2017 at 10:00 AM, ?ric Pailleau >> > wrote: > >> > >> Hi, > >> T is already sam2. > >> Strings are list so try [H2|T2]=[T] ... > >> Regards > >> > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-questions > >> > >> > >> > >> > >> > >> -- > >> Best Regards. > >> Taras Halturin > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From bchamagne@REDACTED Fri Jul 21 10:00:06 2017 From: bchamagne@REDACTED (Bastien CHAMAGNE) Date: Fri, 21 Jul 2017 10:00:06 +0200 Subject: [erlang-questions] Process swarm vs Queues In-Reply-To: References: <9705d84fceeb90f6378f1ce11b872851@demblans.com> Message-ID: Hi, in contrast with Dmitry, I'd chose to use a third party message broker (such as RabbitMQ). It's resilience is proven and I trust that their uptime is better than my app. Then you can have a consumer (or a pool of consumers) per queue. If nothing is done, I'd chose this path. On 20/07/2017 19:27, Dmitry Kolesnikov wrote: > Hello, > > Short answer: Process swarm > > You'll going to implement a task scheduling routines if you choose a queuing approach. A similar task scheduling routines are already implemented by VM. You are not going to implement more efficiently then it is already done. The process pool + queue is an approach to deal with external system. > > The process per action is a natural approach in the actor systems. The memory overhead is reasonable, hibernate feature helps you to minimize it to few bytes. The CPU overhead to spawn a new process is reasonable as well. You can run millions of process on the node. The process per action helps you with GC, fault tolerance and makes the implementation simple. > > Best Regards, > Dmitry >> -|-|-(*> >> On 20 Jul 2017, at 19.49, lud wrote: >> >> Hi, >> >> I would like some advice regarding the design of my system. >> >> I have a couple of processes monitoring data endpoints on the internet, and sending events in my system when data changes. >> Then, I have a swarm of processes dedicated to handle those events. These processes are different, it's not the same code that handles changes for different resources types (comments, feeds, >> >> The specific things : >> * Processes register themselves to an ETS table to tell which resources they monitor. >> * Processes states are very important and I can't afford to lose them. So the state is saved to disk after every handled event, and retrieved on restart. >> * Events are quite rare, about 10 per second, whereas I could have 1000 or 10,000 monitored resources. >> >> At this point, I was thinking : why use a process for each resource and have so much hibernating processes. Why not just use a job queue with 10 workers, receive an event, load the data from disk, handle the event, save to disk ? >> >> It seems correct to me. I started with processes because it feels natural, but now I'm quite lost, I don't need all those idling processes. I feel like I was just thinking OOP (SHAME ! Just kidding ?). >> >> How do you choose, why would you choose one of these two designs, or one another ? >> >> Thank you for reading >> >> Best regards >> >> Ludovic >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From zxq9@REDACTED Fri Jul 21 10:46:57 2017 From: zxq9@REDACTED (zxq9) Date: Fri, 21 Jul 2017 17:46:57 +0900 Subject: [erlang-questions] Changes to string module Message-ID: <1815494.gRpnluj31E@changa> I missed it when looking through R20 release notes, but on referencing the string module I noticed a LOT of changes have happened there. String objects are now more or less based on unicode:chardata() and utf8 graphemes. Whoever is responsible for this -- THANK YOU. For those of us in East Asia life just got a bit easier. Not 100% easy, because what fun would that be, but this sure is a lot nicer. Yay! -Craig From frank.muller.erl@REDACTED Fri Jul 21 11:11:24 2017 From: frank.muller.erl@REDACTED (Frank Muller) Date: Fri, 21 Jul 2017 09:11:24 +0000 Subject: [erlang-questions] "erl_drv_output_term" vs "driver_output_binary" ? Message-ID: Hi there, I would like to know the difference between the two calls. My linked-in driver has to send big (~4MB in average) binaries to the Erlang owning process. 1. Which call is better suited from that ? 2. Does every binary gets copied or just reference counted? 3. Any better alternative to use? 4. Anything else I should be aware of? Many thanks... /Frank -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Fri Jul 21 11:44:50 2017 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 21 Jul 2017 11:44:50 +0200 Subject: [erlang-questions] "erl_drv_output_term" vs "driver_output_binary" ? In-Reply-To: References: Message-ID: <20170721094450.GA43801@erix.ericsson.se> On Fri, Jul 21, 2017 at 09:11:24AM +0000, Frank Muller wrote: > Hi there, > > I would like to know the difference between the two calls. > > My linked-in driver has to send big (~4MB in average) binaries to the > Erlang owning process. > > 1. Which call is better suited from that ? driver_output_binary(port, NULL, 0, bin, offset, len) will be received by the owning process as {Port,{data,Bin}}. A containing integer list can be added using hbuf != NULL. erl_drv_output_term(port, term, n) will be received by the owning process simply as Term. This involves parsing the term in ErlDrvTermData[] format to be able to produce any term. > 2. Does every binary gets copied or just reference counted? Binaries from a driver gets reference counted with either of these APIs. > 3. Any better alternative to use? I think these are fairly equivalent except that one produces a term on a predefined format. > 4. Anything else I should be aware of? If your driver needs the binary after sending it to Erlang it will have to increment the reference count itself, and free it later after decrementing the reference count. The driver can not change the data in the binary after sending it to Erlang. That has very undefined consequences. > > Many thanks... > /Frank -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From frank.muller.erl@REDACTED Fri Jul 21 12:00:42 2017 From: frank.muller.erl@REDACTED (Frank Muller) Date: Fri, 21 Jul 2017 10:00:42 +0000 Subject: [erlang-questions] "erl_drv_output_term" vs "driver_output_binary" ? In-Reply-To: <20170721094450.GA43801@erix.ericsson.se> References: <20170721094450.GA43801@erix.ericsson.se> Message-ID: Thanks Raimo. I'll stick with "driver_output_binary" for now. /Frank Le ven. 21 juil. 2017 ? 11:44, Raimo Niskanen < raimo+erlang-questions@REDACTED> a ?crit : > On Fri, Jul 21, 2017 at 09:11:24AM +0000, Frank Muller wrote: > > Hi there, > > > > I would like to know the difference between the two calls. > > > > My linked-in driver has to send big (~4MB in average) binaries to the > > Erlang owning process. > > > > 1. Which call is better suited from that ? > > driver_output_binary(port, NULL, 0, bin, offset, len) will be received by > the owning process as {Port,{data,Bin}}. A containing integer list can be > added using hbuf != NULL. > > erl_drv_output_term(port, term, n) will be received by the owning process > simply as Term. This involves parsing the term in ErlDrvTermData[] format > to be able to produce any term. > > > 2. Does every binary gets copied or just reference counted? > > Binaries from a driver gets reference counted with either of these APIs. > > > 3. Any better alternative to use? > > I think these are fairly equivalent except that one produces a term on a > predefined format. > > > 4. Anything else I should be aware of? > > If your driver needs the binary after sending it to Erlang it will have to > increment the reference count itself, and free it later after decrementing > the reference count. > > The driver can not change the data in the binary after sending it to > Erlang. That has very undefined consequences. > > > > > Many thanks... > > /Frank > > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ludovic@REDACTED Fri Jul 21 12:03:41 2017 From: ludovic@REDACTED (lud) Date: Fri, 21 Jul 2017 12:03:41 +0200 Subject: [erlang-questions] Process swarm vs Queues In-Reply-To: References: <9705d84fceeb90f6378f1ce11b872851@demblans.com> Message-ID: <47ac8d7b758bf0e98250244de04b84fb@demblans.com> Hello, I was not thinking about third party services because I only have one app, just pure Erlang libraries. I still lean towards process swarm because the implementation feels more natural to me. I will finish that and see how it behaves. Thank you both for your answers :) Ludovic Le 2017-07-21 10:00, Bastien CHAMAGNE a ?crit?: > Hi, > > in contrast with Dmitry, I'd chose to use a third party message broker > (such as RabbitMQ). It's resilience is proven and I trust that their > uptime is better than my app. Then you can have a consumer (or a pool > of consumers) per queue. > > If nothing is done, I'd chose this path. > > > On 20/07/2017 19:27, Dmitry Kolesnikov wrote: >> Hello, >> >> Short answer: Process swarm >> >> You'll going to implement a task scheduling routines if you choose a >> queuing approach. A similar task scheduling routines are already >> implemented by VM. You are not going to implement more efficiently >> then it is already done. The process pool + queue is an approach to >> deal with external system. >> >> The process per action is a natural approach in the actor systems. The >> memory overhead is reasonable, hibernate feature helps you to minimize >> it to few bytes. The CPU overhead to spawn a new process is >> reasonable as well. You can run millions of process on the node. The >> process per action helps you with GC, fault tolerance and makes the >> implementation simple. >> >> Best Regards, >> Dmitry >>> -|-|-(*> >>> On 20 Jul 2017, at 19.49, lud wrote: >>> >>> Hi, >>> >>> I would like some advice regarding the design of my system. >>> >>> I have a couple of processes monitoring data endpoints on the >>> internet, and sending events in my system when data changes. >>> Then, I have a swarm of processes dedicated to handle those events. >>> These processes are different, it's not the same code that handles >>> changes for different resources types (comments, feeds, >>> >>> The specific things : >>> * Processes register themselves to an ETS table to tell which >>> resources they monitor. >>> * Processes states are very important and I can't afford to lose >>> them. So the state is saved to disk after every handled event, and >>> retrieved on restart. >>> * Events are quite rare, about 10 per second, whereas I could have >>> 1000 or 10,000 monitored resources. >>> >>> At this point, I was thinking : why use a process for each resource >>> and have so much hibernating processes. Why not just use a job queue >>> with 10 workers, receive an event, load the data from disk, handle >>> the event, save to disk ? >>> >>> It seems correct to me. I started with processes because it feels >>> natural, but now I'm quite lost, I don't need all those idling >>> processes. I feel like I was just thinking OOP (SHAME ! Just kidding >>> ?). >>> >>> How do you choose, why would you choose one of these two designs, or >>> one another ? >>> >>> Thank you for reading >>> >>> Best regards >>> >>> Ludovic >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From mikpelinux@REDACTED Fri Jul 21 13:09:54 2017 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Fri, 21 Jul 2017 13:09:54 +0200 Subject: [erlang-questions] Process swarm vs Queues In-Reply-To: <9705d84fceeb90f6378f1ce11b872851@demblans.com> References: <9705d84fceeb90f6378f1ce11b872851@demblans.com> Message-ID: <22897.57602.854969.752600@gargle.gargle.HOWL> lud writes: > Hi, > > I would like some advice regarding the design of my system. > > I have a couple of processes monitoring data endpoints on the internet, > and sending events in my system when data changes. > Then, I have a swarm of processes dedicated to handle those events. > These processes are different, it's not the same code that handles > changes for different resources types (comments, feeds, > > The specific things : > * Processes register themselves to an ETS table to tell which resources > they monitor. > * Processes states are very important and I can't afford to lose them. > So the state is saved to disk after every handled event, and retrieved > on restart. > * Events are quite rare, about 10 per second, whereas I could have 1000 > or 10,000 monitored resources. > > At this point, I was thinking : why use a process for each resource and > have so much hibernating processes. Why not just use a job queue with 10 > workers, receive an event, load the data from disk, handle the event, > save to disk ? > > It seems correct to me. I started with processes because it feels > natural, but now I'm quite lost, I don't need all those idling > processes. I feel like I was just thinking OOP (SHAME ! Just kidding ?). > > How do you choose, why would you choose one of these two designs, or one > another ? Your problem seems very under-defined. In particular, we don't know the overhead of processing an event, or what you're trying to optimize (latency? throughput? robustness?). The processes that want to monitor resources, is that the external API to your system or an implementation detail within your system? Anyway, since you mention reading and writing state to disk around each handled event, minimizing latency cannot be critical. Therefore I don't see the need for anything complicated here: just spawn a temporary process for each event as it occurs. If you need serialization, add a gen_server. If state is precious, have a supervisor own it. Don't overengineer unless you have proof that the simple solution doesn't work. From ludovic@REDACTED Fri Jul 21 13:58:08 2017 From: ludovic@REDACTED (lud) Date: Fri, 21 Jul 2017 13:58:08 +0200 Subject: [erlang-questions] Process swarm vs Queues In-Reply-To: <22897.57602.854969.752600@gargle.gargle.HOWL> References: <9705d84fceeb90f6378f1ce11b872851@demblans.com> <22897.57602.854969.752600@gargle.gargle.HOWL> Message-ID: <5f4d11120716ee979b8183954f7eaa4b@demblans.com> Hi, > Your problem seems very under-defined. In particular, we don't know > the overhead of processing an event, or what you're trying to optimize > (latency? throughput? robustness?). The processes that want to monitor > resources, is that the external API to your system or an implementation > detail within your system? It is not (yet) about optimizing but rather about how to chose a particular design around state and concurrency. My example is simple and anyone here can implement all the possible solutions, but it is not obvious to me why a specific solution is the best. > Anyway, since you mention reading and writing state to disk around each > handled event, minimizing latency cannot be critical. Therefore I > don't > see the need for anything complicated here: just spawn a temporary > process > for each event as it occurs. If you need serialization, add a > gen_server. > If state is precious, have a supervisor own it. > > Don't overengineer unless you have proof that the simple solution > doesn't > work. At the moment, I have event handlers processes register properties on gproc to be notified about the resources they monitor. I can directly send the event via the pub/sub feature of gproc. To use a queue or spawn a process, I would need an ETS table registering the handler ID with the ressource, to be able to spawn a handler with the appropriate state. So I'll follow your advice and keep it simple, finish the work, and see if the RAM is a problem. Thank you :) From frank.muller.erl@REDACTED Fri Jul 21 14:24:11 2017 From: frank.muller.erl@REDACTED (Frank Muller) Date: Fri, 21 Jul 2017 12:24:11 +0000 Subject: [erlang-questions] "erl_drv_output_term" vs "driver_output_binary" ? In-Reply-To: References: <20170721094450.GA43801@erix.ericsson.se> Message-ID: One more question Raimo: how about the opposite scenario: Erlang sending big binary to the driver? 1. Is the binary simply reference-counted? 2. What if the Erlang side change the binary after sending it? Should I worry about that? /Frank Thanks Raimo. I'll stick with "driver_output_binary" for now. > > /Frank > > Le ven. 21 juil. 2017 ? 11:44, Raimo Niskanen < > raimo+erlang-questions@REDACTED> a ?crit : > >> On Fri, Jul 21, 2017 at 09:11:24AM +0000, Frank Muller wrote: >> > Hi there, >> > >> > I would like to know the difference between the two calls. >> > >> > My linked-in driver has to send big (~4MB in average) binaries to the >> > Erlang owning process. >> > >> > 1. Which call is better suited from that ? >> >> driver_output_binary(port, NULL, 0, bin, offset, len) will be received by >> the owning process as {Port,{data,Bin}}. A containing integer list can be >> added using hbuf != NULL. >> >> erl_drv_output_term(port, term, n) will be received by the owning process >> simply as Term. This involves parsing the term in ErlDrvTermData[] format >> to be able to produce any term. >> >> > 2. Does every binary gets copied or just reference counted? >> >> Binaries from a driver gets reference counted with either of these APIs. >> >> > 3. Any better alternative to use? >> >> I think these are fairly equivalent except that one produces a term on a >> predefined format. >> >> > 4. Anything else I should be aware of? >> >> If your driver needs the binary after sending it to Erlang it will have to >> increment the reference count itself, and free it later after decrementing >> the reference count. >> >> The driver can not change the data in the binary after sending it to >> Erlang. That has very undefined consequences. >> >> > >> > Many thanks... >> > /Frank >> >> >> -- >> >> / Raimo Niskanen, Erlang/OTP, Ericsson AB >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Fri Jul 21 16:02:51 2017 From: lloyd@REDACTED (Lloyd R. Prentice) Date: Fri, 21 Jul 2017 10:02:51 -0400 Subject: [erlang-questions] Changes to string module In-Reply-To: <1815494.gRpnluj31E@changa> References: <1815494.gRpnluj31E@changa> Message-ID: <3D4F4F4F-27EF-42A0-8F19-F36FC4B46254@writersglen.com> Hi all, I can appreciate the reasons for the changes, but it has created moments of frustration for me. I'm running an earlier version of Erlang. Plan to upgrade, but not yet. My work habit is to frequently consult on-line Erlang docs. The other day I looked up string:span/2, which I've used in various places throughout my code. But what's this? It's marked "obsolete - use take/2." I must have caught the docs at a point of transition since there was no take/2 in the list of string functions. What to do? What to do? That version of the docs seems to have been updated. Both take/2 and span/2 are now in the list. OK, I can live with momentary and passing frustration. But now, when I upgrade Erlang, do I have to worry that span/2 will be dropped at some point--- after all, it's "obsolete." Or do I have run two versions of Erlang? Plus, I now find the string docs much harder to use since I have to think about whether a given function is in my version of Erlang or not. Petty issues and, perhaps the price of progress. But it does illustrate that library revision may have unintended consequences. Best wishes, LRP Sent from my iPad > On Jul 21, 2017, at 4:46 AM, zxq9 wrote: > > I missed it when looking through R20 release notes, but on referencing the string module I noticed a LOT of changes have happened there. String objects are now more or less based on unicode:chardata() and utf8 graphemes. > > Whoever is responsible for this -- THANK YOU. > > For those of us in East Asia life just got a bit easier. Not 100% easy, because what fun would that be, but this sure is a lot nicer. > > Yay! > -Craig > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From dgud@REDACTED Fri Jul 21 16:17:47 2017 From: dgud@REDACTED (Dan Gudmundsson) Date: Fri, 21 Jul 2017 14:17:47 +0000 Subject: [erlang-questions] Changes to string module In-Reply-To: <3D4F4F4F-27EF-42A0-8F19-F36FC4B46254@writersglen.com> References: <1815494.gRpnluj31E@changa> <3D4F4F4F-27EF-42A0-8F19-F36FC4B46254@writersglen.com> Message-ID: On Fri, Jul 21, 2017 at 4:02 PM Lloyd R. Prentice wrote: > Hi all, > > I can appreciate the reasons for the changes, but it has created moments > of frustration for me. > > I'm running an earlier version of Erlang. Plan to upgrade, but not yet. My > work habit is to frequently consult on-line Erlang docs. > > The other day I looked up string:span/2, which I've used in various places > throughout my code. But what's this? It's marked "obsolete - use take/2." > > I must have caught the docs at a point of transition since there was no > take/2 in the list of string functions. What to do? What to do? > > That version of the docs seems to have been updated. Both take/2 and > span/2 are now in the list. > > OK, I can live with momentary and passing frustration. But now, when I > upgrade Erlang, do I have to worry that span/2 will be dropped at some > point--- after all, it's "obsolete." > It might be dropped at some point, but not in any near future, not until OTP-23 and probably not in that release either. We will deprecate (and add warnings) and remove the docs of the old functions in OTP-21. The old functions will be kept. > Or do I have run two versions of Erlang? > > Plus, I now find the string docs much harder to use since I have to think > about whether a given function is in my version of Erlang or not. > > Petty issues and, perhaps the price of progress. But it does illustrate > that library revision may have unintended consequences. > The only difference right now (in OTP-20) is the addition of new functions and the text that warns that the old ones will be deprecated in 21. So the only problem you might get in OTP-21 is deprecated warnings for using old functions which you can suppress. /Dan > Best wishes, > > LRP > > Sent from my iPad > > > On Jul 21, 2017, at 4:46 AM, zxq9 wrote: > > > > I missed it when looking through R20 release notes, but on referencing > the string module I noticed a LOT of changes have happened there. String > objects are now more or less based on unicode:chardata() and utf8 graphemes. > > > > Whoever is responsible for this -- THANK YOU. > > > > For those of us in East Asia life just got a bit easier. Not 100% easy, > because what fun would that be, but this sure is a lot nicer. > > > > Yay! > > -Craig > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stamarit@REDACTED Fri Jul 21 17:15:40 2017 From: stamarit@REDACTED (Salvador Tamarit) Date: Fri, 21 Jul 2017 17:15:40 +0200 Subject: [erlang-questions] [edoc] macro for referring a parameter & multiple @doc tags Message-ID: Hi, I'm trying to write automatically some edoc in a program, but I'm finding some difficulties. The first barrier is not having a macro to refer a parameter of a function. I've seen that by using edoc:get_doc/* it is possible to have the parameters names accesible through an XML, but I would expect a easier way to obtain them. I think that it could be very useful to have a macro like {@p n} to refer to the nth parameter. This macro could be replaced by the parameter name in the generated documentation. The second barrier is the limit of one @doc tag per function. I understand that this is due to some parsing constraint that I'm failing to see. If it is not the case, then it would be interesting to enable multiple @doc tags and simply join them together when they are printed. This would ease the task of automatically generate new documentation in a function that already had user-defined documentation. So the question here is, is some of these edoc changes feasible? Or even better, is what I want to do doable by using other edoc's macros/constructions? Thanks in advance. Salvador Tamarit -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Fri Jul 21 17:16:23 2017 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 21 Jul 2017 17:16:23 +0200 Subject: [erlang-questions] "erl_drv_output_term" vs "driver_output_binary" ? In-Reply-To: References: <20170721094450.GA43801@erix.ericsson.se> Message-ID: <20170721151623.GB43801@erix.ericsson.se> On Fri, Jul 21, 2017 at 12:24:11PM +0000, Frank Muller wrote: > One more question Raimo: how about the opposite scenario: Erlang sending > big binary to the driver? > > 1. Is the binary simply reference-counted? Yes. If the driver implements the driver_entry outputv(). > 2. What if the Erlang side change the binary after > sending it? Should I worry about that? Nope. All terms are read-only, from Erlang's point of view. > > /Frank > > > Thanks Raimo. I'll stick with "driver_output_binary" for now. > > > > /Frank > > > > Le ven. 21 juil. 2017 ? 11:44, Raimo Niskanen < > > raimo+erlang-questions@REDACTED> a ?crit : > > > >> On Fri, Jul 21, 2017 at 09:11:24AM +0000, Frank Muller wrote: > >> > Hi there, > >> > > >> > I would like to know the difference between the two calls. > >> > > >> > My linked-in driver has to send big (~4MB in average) binaries to the > >> > Erlang owning process. > >> > > >> > 1. Which call is better suited from that ? > >> > >> driver_output_binary(port, NULL, 0, bin, offset, len) will be received by > >> the owning process as {Port,{data,Bin}}. A containing integer list can be > >> added using hbuf != NULL. > >> > >> erl_drv_output_term(port, term, n) will be received by the owning process > >> simply as Term. This involves parsing the term in ErlDrvTermData[] format > >> to be able to produce any term. > >> > >> > 2. Does every binary gets copied or just reference counted? > >> > >> Binaries from a driver gets reference counted with either of these APIs. > >> > >> > 3. Any better alternative to use? > >> > >> I think these are fairly equivalent except that one produces a term on a > >> predefined format. > >> > >> > 4. Anything else I should be aware of? > >> > >> If your driver needs the binary after sending it to Erlang it will have to > >> increment the reference count itself, and free it later after decrementing > >> the reference count. > >> > >> The driver can not change the data in the binary after sending it to > >> Erlang. That has very undefined consequences. > >> > >> > > >> > Many thanks... > >> > /Frank > >> > >> > >> -- > >> > >> / Raimo Niskanen, Erlang/OTP, Ericsson AB > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-questions > >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From list1@REDACTED Fri Jul 21 17:22:17 2017 From: list1@REDACTED (Grzegorz Junka) Date: Fri, 21 Jul 2017 15:22:17 +0000 Subject: [erlang-questions] Changes to string module In-Reply-To: <3D4F4F4F-27EF-42A0-8F19-F36FC4B46254@writersglen.com> References: <1815494.gRpnluj31E@changa> <3D4F4F4F-27EF-42A0-8F19-F36FC4B46254@writersglen.com> Message-ID: On 21/07/2017 14:02, Lloyd R. Prentice wrote: > Hi all, > > I can appreciate the reasons for the changes, but it has created moments of frustration for me. > > I'm running an earlier version of Erlang. Plan to upgrade, but not yet. My work habit is to frequently consult on-line Erlang docs. > > The other day I looked up string:span/2, which I've used in various places throughout my code. But what's this? It's marked "obsolete - use take/2." > > I must have caught the docs at a point of transition since there was no take/2 in the list of string functions. What to do? What to do? > > That version of the docs seems to have been updated. Both take/2 and span/2 are now in the list. > > OK, I can live with momentary and passing frustration. But now, when I upgrade Erlang, do I have to worry that span/2 will be dropped at some point--- after all, it's "obsolete." > > Or do I have run two versions of Erlang? > > Plus, I now find the string docs much harder to use since I have to think about whether a given function is in my version of Erlang or not. > Isn't just following a documentation for your version enough? http://www.erlang.org/docs/versions/ Regards Grzegorz From fred@REDACTED Fri Jul 21 17:22:54 2017 From: fred@REDACTED (Fred Dushin) Date: Fri, 21 Jul 2017 11:22:54 -0400 Subject: [erlang-questions] [ANN] Sonic Pi 3.0 released In-Reply-To: References: Message-ID: <8256C2DD-8955-4EA1-8FAF-0ADBE81DF408@dushin.net> I have always been curious about how hard it would be to port a very small subset of Erlang to FreeRTOS, so that it could be run on cheap micro-controllers like the ESP8266 (or the ESP32, now that it is being produced in volume). I've done a bit of hobbying with micropython on the ESP8266, and while it is a gas, trying to deal with concurrency (asyncio) in python is a nightmare [1]. Des anyone actually think coroutines are a sound idea? (Likely I just don't get it) Abstracting all the concurrency out the way with Erlang seem ideal for embedded systems, IMO, even if you are dealing with only one scheduler. -Fred [1] Grep for `yield` at https://github.com/fadushin/esp8266/blob/809360a9bd99ddbb920edf4f734d803036dec868/micropython/uhttpd/uhttpd.py , if you want your eyes to bleed. > On Jul 19, 2017, at 6:45 AM, Joe Armstrong wrote: > > Sonic Pi V3 now includes a complete Erlang distribution. > > Sonic Pi is a complete programmable music making machine, > for teaching kids to program and for music experiments. > > The Erlang is well hidden away - but it's there > together with a complete Ruby and Supercollider (also hidden) > > So far I've only tested this on my Mac - but I think Erlang > is also included in the rasberry Pi, linux and windows distributions > (or at least will be) > > This is actually an amazing bit of engineering - in a single desktop app > Sonic Pi includes complete stripped down versions of Ruby and Erlang > and the Supercollider. All these are isolated components talking > together through OSC over UDP. > > (See http://joearms.github.io/2016/01/28/A-Badass-Way-To-Connect-Programs-Together.html > - for details of OSC) > > Sonic Pi is programmed in Ruby+Erlang+C++ + Supercollider language > and uses QT for the interface. > > This is how systems should be built. > > Sam has done a fantastic job job here - as a side effect of this > Erlang will be in the standard Rasberry Pi distro - whether it stays there > is up to YOU - Sam has done the ground work - this actually opens the > SonicPi infrastructure to Erlang and Elixir Programmers > > So what are you waiting for? - Go write a drum machine in Erlang > or an arpeggiator or a harmonizer - or write it in Elixir if that is > your thing. > > Have fun > > /Joe > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Fri Jul 21 19:18:29 2017 From: erlang@REDACTED (Joe Armstrong) Date: Fri, 21 Jul 2017 19:18:29 +0200 Subject: [erlang-questions] [ANN] Sonic Pi 3.0 released In-Reply-To: <8256C2DD-8955-4EA1-8FAF-0ADBE81DF408@dushin.net> References: <8256C2DD-8955-4EA1-8FAF-0ADBE81DF408@dushin.net> Message-ID: Ummm - this has (according to Mr Wiki) 96 KB or RAM - this is for the OS + application this is really not enough memory - You'd need to totally redesign the instruction set (which is today a 32 threaded code) - with (say) huffman encoded instructions and make a tiny emulator and throw away all the BIFS (in C) - when you'd done this it would no longer be Erlang. (Erlang + OS did fit into 640Kb a while back (it ran on windows) but 96 KB would be just way too little memory) Some kind of parallel forth might be better. Cheers /Joe On Fri, Jul 21, 2017 at 5:22 PM, Fred Dushin wrote: > I have always been curious about how hard it would be to port a very small > subset of Erlang to FreeRTOS, so that it could be run on cheap > micro-controllers like the ESP8266 (or the ESP32, now that it is being > produced in volume). > > I've done a bit of hobbying with micropython on the ESP8266, and while it is > a gas, trying to deal with concurrency (asyncio) in python is a nightmare > [1]. Des anyone actually think coroutines are a sound idea? (Likely I > just don't get it) > > Abstracting all the concurrency out the way with Erlang seem ideal for > embedded systems, IMO, even if you are dealing with only one scheduler. > > -Fred > > [1] Grep for `yield` at > https://github.com/fadushin/esp8266/blob/809360a9bd99ddbb920edf4f734d803036dec868/micropython/uhttpd/uhttpd.py, > if you want your eyes to bleed. > > On Jul 19, 2017, at 6:45 AM, Joe Armstrong wrote: > > Sonic Pi V3 now includes a complete Erlang distribution. > > Sonic Pi is a complete programmable music making machine, > for teaching kids to program and for music experiments. > > The Erlang is well hidden away - but it's there > together with a complete Ruby and Supercollider (also hidden) > > So far I've only tested this on my Mac - but I think Erlang > is also included in the rasberry Pi, linux and windows distributions > (or at least will be) > > This is actually an amazing bit of engineering - in a single desktop app > Sonic Pi includes complete stripped down versions of Ruby and Erlang > and the Supercollider. All these are isolated components talking > together through OSC over UDP. > > (See > http://joearms.github.io/2016/01/28/A-Badass-Way-To-Connect-Programs-Together.html > - for details of OSC) > > Sonic Pi is programmed in Ruby+Erlang+C++ + Supercollider language > and uses QT for the interface. > > This is how systems should be built. > > Sam has done a fantastic job job here - as a side effect of this > Erlang will be in the standard Rasberry Pi distro - whether it stays there > is up to YOU - Sam has done the ground work - this actually opens the > SonicPi infrastructure to Erlang and Elixir Programmers > > So what are you waiting for? - Go write a drum machine in Erlang > or an arpeggiator or a harmonizer - or write it in Elixir if that is > your thing. > > Have fun > > /Joe > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From codewiget95@REDACTED Fri Jul 21 21:35:48 2017 From: codewiget95@REDACTED (code wiget) Date: Fri, 21 Jul 2017 15:35:48 -0400 Subject: [erlang-questions] Is a supervisor necessary here/when should I use one? Message-ID: <9EED6678-42DE-4603-B2A0-37FA01266A16@gmail.com> Hello, I have an Erlang server running on my system(emqtt), and I created a plugin for it. In this plugin, I have one function that I would like to run once on startup called startup() that passes the next function to the environment as a function reference and is used thousands of times a minute (ideally). My function simply searches a database for a key and returns a value. The function that is run hundreds of times a minute does not wait around with a receive though. I am reading the textbook ?learn you some Erlang for good,? and all of the ?workers? described are constantly waiting on messages(receive) and performing actions. This function is just a function though? like if you had a function 2+2, it is simple. So, when I enable the plugin and the supervisor starts, my startup() function is run properly, but exits and error text is displayed after completing properly because the worker is not, well, doing anything until it is started to be called. Conceptually, I am new to this. Is there any place for a supervisor here? My goals are to run the startup script that just sets the function in the environment and to optimize my function speed. If there is no place for a supervisor, how would I run my Erlang startup program without having the console freak out at me? Thank you for your help! From zxq9@REDACTED Sun Jul 23 13:58:17 2017 From: zxq9@REDACTED (zxq9) Date: Sun, 23 Jul 2017 20:58:17 +0900 Subject: [erlang-questions] Is a supervisor necessary here/when should I use one? In-Reply-To: <9EED6678-42DE-4603-B2A0-37FA01266A16@gmail.com> References: <9EED6678-42DE-4603-B2A0-37FA01266A16@gmail.com> Message-ID: <3275069.6B1ZvMNv7X@changa> On 2017?07?21? ??? 15:35:48 code wiget wrote: > Conceptually, I am new to this. Is there any place for a supervisor here? My goals are to run the startup script that just sets the function in the environment and to optimize my function speed. If there is no place for a supervisor, how would I run my Erlang startup program without having the console freak out at me? Functions don't have supervisors, processes do. Think about processes as workers in your information factory. Think about functions as things your workers do -- and ANY worker may perform ANY function (potentially). With this mental image in mind answer the question: Which process is calling this function? The answer will tell you the context of the execution. The context of execution will answer the rest of your questions as a matter of course (and if not, you will automatically solicit many experienced opinions here if you answer the question above publicly in this thread -- and especially if you continue to brainstorm by typing things out here). From lloyd@REDACTED Sun Jul 23 21:53:42 2017 From: lloyd@REDACTED (lloyd@REDACTED) Date: Sun, 23 Jul 2017 15:53:42 -0400 (EDT) Subject: [erlang-questions] Changes to string module In-Reply-To: References: <1815494.gRpnluj31E@changa> <3D4F4F4F-27EF-42A0-8F19-F36FC4B46254@writersglen.com> Message-ID: <1500839622.60232323@apps.rackspace.com> Hi Dan, A big thumbs up for your work on Erlang, but... At risk of being tagged culturally insensitive, Is it presumptions of me to ask if we could please split the new Unicode string functions into a separate library and preserve the ascii string functions as we find them in older Erlang versions? I've been working with ascii string functions but now find the new docs much harder to work with, e.g. to my eye too much visual noise, plus stuff like this: - string:chr/2 (and rchr/2) returns an index into a string. But we're told "This function is [ obsolete ]( http://erlang.org/doc/man/string.html#oldapi ). Use [ find/2 ]( http://erlang.org/doc/man/string.html#find-2 )." find/2, however, returns "returns the remainder of the string or nomatch...." - similarly, string:cspan/2 is marked "This function is [ obsolete ]( http://erlang.org/doc/man/string.html#oldapi ). Use [ take/3 ]( http://erlang.org/doc/man/string.html#take-3 )." But string:take/3 returns leading and trailing data. Plus, I dread the future necessity of rewriting string code. I can certainly see the value of adding functions that support Unicode. And applaud them. But stomping on existing ascii functions seems like a stretch too far. Thanks, LRP -----Original Message----- From: "Dan Gudmundsson" Sent: Friday, July 21, 2017 10:17am To: "Lloyd R. Prentice" , "zxq9" Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] Changes to string module On Fri, Jul 21, 2017 at 4:02 PM Lloyd R. Prentice <[ lloyd@REDACTED ]( mailto:lloyd@REDACTED )> wrote:Hi all, I can appreciate the reasons for the changes, but it has created moments of frustration for me. I'm running an earlier version of Erlang. Plan to upgrade, but not yet. My work habit is to frequently consult on-line Erlang docs. The other day I looked up string:span/2, which I've used in various places throughout my code. But what's this? It's marked "obsolete - use take/2." I must have caught the docs at a point of transition since there was no take/2 in the list of string functions. What to do? What to do? That version of the docs seems to have been updated. Both take/2 and span/2 are now in the list. OK, I can live with momentary and passing frustration. But now, when I upgrade Erlang, do I have to worry that span/2 will be dropped at some point--- after all, it's "obsolete." It might be dropped at some point, but not in any near future, not until OTP-23 and probably not in that release either. We will deprecate (and add warnings) and remove the docs of the old functions in OTP-21. The old functions will be kept. Or do I have run two versions of Erlang? Plus, I now find the string docs much harder to use since I have to think about whether a given function is in my version of Erlang or not. Petty issues and, perhaps the price of progress. But it does illustrate that library revision may have unintended consequences. The only difference right now (in OTP-20) is the addition of new functions and the text that warns that the old ones will be deprecated in 21. So the only problem you might get in OTP-21 is deprecated warnings for using old functions which you can suppress. /Dan Best wishes, LRP Sent from my iPad > On Jul 21, 2017, at 4:46 AM, zxq9 <[ zxq9@REDACTED ]( mailto:zxq9@REDACTED )> wrote: > > I missed it when looking through R20 release notes, but on referencing the string module I noticed a LOT of changes have happened there. String objects are now more or less based on unicode:chardata() and utf8 graphemes. > > Whoever is responsible for this -- THANK YOU. > > For those of us in East Asia life just got a bit easier. Not 100% easy, because what fun would that be, but this sure is a lot nicer. > > Yay! > -Craig > _______________________________________________ > erlang-questions mailing list > [ erlang-questions@REDACTED ]( mailto:erlang-questions@REDACTED ) > [ http://erlang.org/mailman/listinfo/erlang-questions ]( http://erlang.org/mailman/listinfo/erlang-questions ) _______________________________________________ erlang-questions mailing list [ erlang-questions@REDACTED ]( mailto:erlang-questions@REDACTED ) [ http://erlang.org/mailman/listinfo/erlang-questions ]( http://erlang.org/mailman/listinfo/erlang-questions ) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Mon Jul 24 03:00:21 2017 From: ok@REDACTED (Richard A. O'Keefe) Date: Mon, 24 Jul 2017 13:00:21 +1200 Subject: [erlang-questions] Changes to string module In-Reply-To: <3D4F4F4F-27EF-42A0-8F19-F36FC4B46254@writersglen.com> References: <1815494.gRpnluj31E@changa> <3D4F4F4F-27EF-42A0-8F19-F36FC4B46254@writersglen.com> Message-ID: <6c472e58-0b20-1d0f-dc13-7b8841eaa457@cs.otago.ac.nz> On 22/07/17 2:02 AM, Lloyd R. Prentice wrote: > I can appreciate the reasons for the changes, but it has created moments of frustration for me. I really don't like to say this, but this is one of the things the Java documentation does right. Fields and methods may be labelled "Since x.y" or "Deprecated since x.y". It would be seriously painful to apply this to the existing Erlang documentation, but perhaps future changes could do this? From soverdor@REDACTED Sun Jul 23 21:33:30 2017 From: soverdor@REDACTED (Sam Overdorf) Date: Sun, 23 Jul 2017 12:33:30 -0700 Subject: [erlang-questions] List of strings problem In-Reply-To: <20170721064008.GA23437@erix.ericsson.se> References: <6d81bdd0-4a39-4b61-a8c9-46357e92fa76@email.android.com> <20170721064008.GA23437@erix.ericsson.se> Message-ID: Thanks for the help. I figured out my problem, I was going to deep into the list. Works as expected. Thanks, Sam On Thu, Jul 20, 2017 at 11:40 PM, Raimo Niskanen wrote: > On Thu, Jul 20, 2017 at 04:57:34PM -0700, Sam Overdorf wrote: >> Thanks for responding so quickly. >> I am using Windows7 could this be causing some of my odd behavior? >> Thanks, >> Sam > > Nope. That should not matter. > > Please re-do your example and cut-and-paste the result hera again, exactly > as Taras did, so there is no room for human error or interpretation... > > f(). > D = [ "sam1", "sam2" ]. > [H|T] = D. > H. > [H2|T2] = T. > H2. > > > >> >> >> On Thu, Jul 20, 2017 at 12:38 AM, PAILLEAU Eric >> wrote: >> > Yes, >> > indeed it is the normal behaviour. >> > I suspect you do something like list flatten before so that >> > [H2|T2] = T. >> > is >> > [H2|T2] = [$s,$a,$m,$2] and you got "s". >> > the reason why I told you to do >> > [H2|T2] = [T]. >> > >> > but minimal test is correct like Taras pointed. >> > >> > regards >> > >> > Le 20/07/2017 ? 09:31, Taras Halturin a ?crit : >> >> >> >> Just to be sure... >> >> >> >> Erlang/OTP 19 [erts-8.2.1] [source] [64-bit] [smp:4:4] [async-threads:10] >> >> [kernel-poll:false] >> >> >> >> Eshell V8.2.1 (abort with ^G) >> >> 1> D = [ "sam1", "sam2" ]. >> >> ["sam1","sam2"] >> >> 2> [H|T] = D. >> >> ["sam1","sam2"] >> >> 3> [H2|T2] = T. >> >> ["sam2"] >> >> 4> T2. >> >> [] >> >> 5> H2. >> >> "sam2" >> >> 6> >> >> >> >> It works as you expected. >> >> >> >> On Thu, Jul 20, 2017 at 10:00 AM, ?ric Pailleau > >> > wrote: >> >> >> >> Hi, >> >> T is already sam2. >> >> Strings are list so try [H2|T2]=[T] ... >> >> Regards >> >> >> >> _______________________________________________ >> >> erlang-questions mailing list >> >> erlang-questions@REDACTED >> >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> >> >> >> >> >> >> >> >> >> -- >> >> Best Regards. >> >> Taras Halturin >> > >> > >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From zxq9@REDACTED Mon Jul 24 07:19:31 2017 From: zxq9@REDACTED (zxq9) Date: Mon, 24 Jul 2017 14:19:31 +0900 Subject: [erlang-questions] Changes to string module In-Reply-To: <1500839622.60232323@apps.rackspace.com> References: <1815494.gRpnluj31E@changa> <1500839622.60232323@apps.rackspace.com> Message-ID: <5384804.DgBppnZMlh@changa> Hi, Lloyd! API changes are a major pain. Hopefully there will not be too many minor traumas as things move forward... On 2017?07?23? ??? 15:53:42 you wrote: > At risk of being tagged culturally insensitive, Is it presumptions of me to ask if we could please split the new Unicode string functions into a separate library and preserve the ascii string functions as we find them in older Erlang versions? Not culturally insensitive -- annoyed at a changing API. That's normal. The original problem was that the "string" module really performed (occasionally redundant) list operations, not string operations, just insufficiently stringish operations. The maintainers went with a jarring approach to change (well sort of -- nothing has been removed yet). This is understandable considering the alternatives. They left functions in place many of us are using, but deprecated many of them, and eventually we will find ourselves with a for-real string module. Quite nice. But the road there is fraught with peril... > I've been working with ascii string functions but now find the new docs much harder to work with, e.g. to my eye too much visual noise, plus stuff like this: > > - string:chr/2 (and rchr/2) returns an index into a string. But we're told "This function is [ obsolete ]( http://erlang.org/doc/man/string.html#oldapi ). Use [ find/2 ]( http://erlang.org/doc/man/string.html#find-2 )." > find/2, however, returns "returns the remainder of the string or nomatch...." Yep. That's a big wtf. Why not just leave that one there or (at worst) move it to something more general where it really belongs like lists:index/2 which the language lacks (because it is usually just not called for and nobody seems to have trouble with this). At a minimum, the docs shouldn't ONLY reference string:find/2,3, but also include a reference to a way to get the exact same behavior -- for example, using the re module: 1> S = "All you need in this life is ignorance and confidence, and then success is sure.". "All you need in this life is ignorance and confidence, and then success is sure." 2> string:chr(S, $i). 14 3> re:run(S, "i"). {match,[{13,1}]} 4> Chr = fun(String, Char) -> case re:run(String, [Char]) of {match, [{I, 1}]} -> I + 1; nomatch -> 0 end end. #Fun 8> Chr(S, $i). 14 Which indicates an internal definition can give us the same effect with -module(my_string). -spec chr(String, Char) -> Index when String :: list(), Char :: non_neg_integer(), Index :: 0 | pos_integer(). chr(String, Char) -> case re:run(String, [Char]) of {match, [{Index, 1}]} -> Index + 1; nomatch -> 0 end. (And then, of course, doing the equivalent of 's/string:chr/my_string:chr/g' over the source...) That is a relatively easy fix that leaves whatever code depends on the exact return value of the current string:chr/2 function without a big rewrite. But having to do so is a bit annoying. Why not leave string:chr/2 in place as-is? I don't really know. Maybe because the string module is intended to conceptually do string processing, not array processing. Or something. Or whatever. > - similarly, string:cspan/2 is marked "This function is [ obsolete ]( http://erlang.org/doc/man/string.html#oldapi ). Use [ take/3 ]( http://erlang.org/doc/man/string.html#take-3 )." > But string:take/3 returns leading and trailing data. That is pretty odd also. Once again, I think the idea here is that the new API is assuming what the intended use of this function typically was, and jumping straight to that intended effect instead of leaving the current intermediate step in place. Once again, the re module can be used to get the same result: 40> string:cspan(S, "abc"). 34 41> string:cspan(S, "ZXY"). 80 42> string:cspan(S, "All"). 0 43> Cspan = fun(S, C) -> case re:run(S, "[" ++ C ++ "]") of {match, [{I, 1}]} -> I; nomatch -> length(S) end end. #Fun 44> Cspan(S, "abc"). 34 45> Cspan(S, "ZXY"). 80 46> Cspan(S, "All"). 0 Which indicates we could do: -module(my_string). -spec cspan(String, Chars) -> Index when String :: [non_neg_integer()], Char :: [non_neg_integer()], Index :: non_neg_integer(). cspan(String, Chars) -> case re:run(String, "[" ++ Chars ++ "]") of {match, [{Index, 1}]} -> Index; nomatch -> length(String) end. (...and once again run sed for cspan on the source). > Plus, I dread the future necessity of rewriting string code. This is annoying -- I totally agree. Overall I think the changes are good. They leave the natural place to do listy things in the lists module, the regexy things in the re module, and truly stringy things over true UTF8 strings -- and this is a HUGE step forward in terms of doing non-Romaji things. BUT WHY some direct 1-for-1 replacement functions, references, advice, etc. is not included in the docs is beyond me. It does little help to direct someone to a string munging function from the docs on a deprecated index function when users have very likely already written their OWN string munging libs based on index return values. Hopefully the switch won't hurt too terribly bad. -Craig PS: Thanks again for the awesome work on strings, Dan! I noticed I had an email sitting in my box from you months ago regarding some Kana functions you had put in. I wound up dropping out of civilization for a bit right then -- and I'll get back to you on it eventually. From essen@REDACTED Mon Jul 24 17:27:04 2017 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Mon, 24 Jul 2017 17:27:04 +0200 Subject: [erlang-questions] [ANN] Cowboy 2.0.0-rc.1 Message-ID: Hello! Cowboy 2.0.0-rc.1 has been released! https://ninenines.eu/articles/cowboy-2.0.0-rc.1/ Full details in the migration guide: https://ninenines.eu/docs/en/cowboy/2.0/guide/migrating_from_1.0/ Enjoy! -- Lo?c Hoguin https://ninenines.eu From vladdu55@REDACTED Mon Jul 24 20:42:26 2017 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Mon, 24 Jul 2017 20:42:26 +0200 Subject: [erlang-questions] Trouble with abstract code, cover and rebar3 Message-ID: Hi! I have a project that gives me headache: on one machine, running "rebar3 test" results in an error like below. Same code on another machine compiles fine, but as far as I can tell the machines should be configured the same way. Obviously, they aren't. Anyone has a suggestion how to find what is going on? The code is compiled with OTP 17, so it shouldn't be related to the recent beam chunk changes in v20... best regards, Vlad ===> erlopts [debug_info, {d,'EUNIT'}, nowarn_missing_spec,warn_deprecated_function, warn_export_all,warn_export_vars,warn_obsolete_guard, warn_shadow_vars,warn_unused_function, warn_unused_import,warn_unused_record, warn_unused_vars,warnings_as_errors, {d,'TEST'}] ===> files to compile ["/home/vlad/projects/erlide_kernel/common/_build/test/lib/erlide_tools/src/runtime_tools_sup.erl", "/home/vlad/projects/erlide_kernel/common/_build/test/lib/erlide_tools/src/ttbe.erl", ...., "/home/vlad/projects/erlide_kernel/common/_build/test/lib/erlide_tools/src/erlide_tools_app.erl"] ===> Compiled runtime_tools_sup.erl ===> Compiled ttbe.erl ===> Compiled erlide_tools_app.erl ===> cover compiling "/home/vlad/projects/erlide_kernel/common/_build/test/lib/erlide_tools/ebin" =ERROR REPORT==== 24-Jul-2017::19:32:04 === Error in process <0.395.0> with exit value: {{case_clause,{error,beam_lib,{invalid_chunk,"/home/vlad/projects/erlide_kernel/common/_build/test/lib/erlide_tools/ebin/ttbe.beam","Abst"}}},[{cover,do_compile_beam,3,[{file,"cover.erl"},{line,1355}]},{cover,main_process_loop... ===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump ===> Uncaught error: {case_clause, {'EXIT', {{case_clause, {error,beam_lib, {invalid_chunk, "/home/vlad/projects/erlide_kernel/common/_build/test/lib/erlide_tools/ebin/ttbe.beam", "Abst"}}}, [{cover,do_compile_beam,3, [{file,"cover.erl"},{line,1355}]}, {cover,main_process_loop,1, [{file,"cover.erl"},{line,600}]}]}}} -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc@REDACTED Mon Jul 24 20:45:34 2017 From: marc@REDACTED (Marc Worrell) Date: Mon, 24 Jul 2017 20:45:34 +0200 Subject: [erlang-questions] [ANN] Cowboy 2.0.0-rc.1 In-Reply-To: References: Message-ID: <1A54FFE5-4453-4D55-822E-9FA41A278218@worrell.nl> Hi Lo?c, Congratulations with this big milestone! Looking forward to try it in the Zotonic pre-1.0. Cheers, Marc > On 24 Jul 2017, at 17:27, Lo?c Hoguin wrote: > > Hello! > > Cowboy 2.0.0-rc.1 has been released! > > https://ninenines.eu/articles/cowboy-2.0.0-rc.1/ > > Full details in the migration guide: > > https://ninenines.eu/docs/en/cowboy/2.0/guide/migrating_from_1.0/ > > Enjoy! > > -- > Lo?c Hoguin > https://ninenines.eu > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From eric.pailleau@REDACTED Mon Jul 24 22:00:59 2017 From: eric.pailleau@REDACTED (=?ISO-8859-1?Q?=C9ric_Pailleau?=) Date: Mon, 24 Jul 2017 22:00:59 +0200 Subject: [erlang-questions] Trouble with abstract code, cover and rebar3 In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Mon Jul 24 22:09:37 2017 From: eric.pailleau@REDACTED (=?ISO-8859-1?Q?=C9ric_Pailleau?=) Date: Mon, 24 Jul 2017 22:09:37 +0200 Subject: [erlang-questions] Trouble with abstract code, cover and rebar3 In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Mon Jul 24 22:09:37 2017 From: eric.pailleau@REDACTED (=?ISO-8859-1?Q?=C9ric_Pailleau?=) Date: Mon, 24 Jul 2017 22:09:37 +0200 Subject: [erlang-questions] Trouble with abstract code, cover and rebar3 In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Mon Jul 24 22:10:59 2017 From: eric.pailleau@REDACTED (=?ISO-8859-1?Q?=C9ric_Pailleau?=) Date: Mon, 24 Jul 2017 22:10:59 +0200 Subject: [erlang-questions] Trouble with abstract code, cover and rebar3 In-Reply-To: Message-ID: <60b4716d-6f0d-48e2-9ff2-7d9b6e7a44a2@email.android.com> An HTML attachment was scrubbed... URL: From vladdu55@REDACTED Mon Jul 24 22:22:37 2017 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Mon, 24 Jul 2017 22:22:37 +0200 Subject: [erlang-questions] Trouble with abstract code, cover and rebar3 In-Reply-To: References: Message-ID: Hi, Yes, that would be a possible answer, but I should be compiling with v17. Will check the beams, just in case. regards, Vlad On Mon, Jul 24, 2017 at 10:00 PM, ?ric Pailleau wrote: > Hi, > invalid_chunk is maybe related to UTF8 atom chunk added in beam format > starting 20.0. > > I needed to change match clauses myself for my geas project. > > Regards > > > Le 24 juil. 2017 8:42 PM, Vlad Dumitrescu a ?crit : > > Hi! > > I have a project that gives me headache: on one machine, running "rebar3 > test" results in an error like below. Same code on another machine compiles > fine, but as far as I can tell the machines should be configured the same > way. Obviously, they aren't. Anyone has a suggestion how to find what is > going on? The code is compiled with OTP 17, so it shouldn't be related to > the recent beam chunk changes in v20... > > best regards, > Vlad > > ===> erlopts [debug_info, > {d,'EUNIT'}, > nowarn_missing_spec,warn_deprecated_function, > warn_export_all,warn_export_ > vars,warn_obsolete_guard, > warn_shadow_vars,warn_unused_function, > warn_unused_import,warn_unused_record, > warn_unused_vars,warnings_as_errors, > {d,'TEST'}] > ===> files to compile ["/home/vlad/projects/erlide_ > kernel/common/_build/test/lib/erlide_tools/src/runtime_tools_sup.erl", > "/home/vlad/projects/erlide_kernel/common/_build/test/lib/ > erlide_tools/src/ttbe.erl", > ...., > "/home/vlad/projects/erlide_kernel/common/_build/test/lib/ > erlide_tools/src/erlide_tools_app.erl"] > ===> Compiled runtime_tools_sup.erl > ===> Compiled ttbe.erl > ===> Compiled erlide_tools_app.erl > ===> cover compiling "/home/vlad/projects/erlide_ > kernel/common/_build/test/lib/erlide_tools/ebin" > > =ERROR REPORT==== 24-Jul-2017::19:32:04 === > Error in process <0.395.0> with exit value: {{case_clause,{error,beam_lib, > {invalid_chunk,"/home/vlad/projects/erlide_kernel/common/ > _build/test/lib/erlide_tools/ebin/ttbe.beam","Abst"}}},[{ > cover,do_compile_beam,3,[{file,"cover.erl"},{line,1355}] > },{cover,main_process_loop... > > ===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or > consult rebar3.crashdump > ===> Uncaught error: {case_clause, > {'EXIT', > {{case_clause, > {error,beam_lib, > {invalid_chunk, > "/home/vlad/projects/erlide_ > kernel/common/_build/test/lib/erlide_tools/ebin/ttbe.beam", > "Abst"}}}, > [{cover,do_compile_beam,3, > [{file,"cover.erl"},{line,1355}]}, > {cover,main_process_loop,1, > [{file,"cover.erl"},{line,600}]}]}}} > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.valim@REDACTED Mon Jul 24 22:23:33 2017 From: jose.valim@REDACTED (=?UTF-8?Q?Jos=C3=A9_Valim?=) Date: Mon, 24 Jul 2017 22:23:33 +0200 Subject: [erlang-questions] Trouble with abstract code, cover and rebar3 In-Reply-To: <60b4716d-6f0d-48e2-9ff2-7d9b6e7a44a2@email.android.com> References: <60b4716d-6f0d-48e2-9ff2-7d9b6e7a44a2@email.android.com> Message-ID: The error message says the invalid chunk is the "Abst" chunk. Maybe try checking out if the chunk can be read manually? beam_lib:chunks("/home/vlad/projects/erlide_kernel/common/ _build/test/lib/erlide_tools/ebin/ttbe.beam", ["Abst"]). And also: beam_lib:chunks("/home/vlad/projects/erlide_kernel/common/ _build/test/lib/erlide_tools/ebin/ttbe.beam", [abstract_code]). And if you are running on OTP 20: beam_lib:chunks("/home/vlad/projects/erlide_kernel/common/ _build/test/lib/erlide_tools/ebin/ttbe.beam", [debug_info]). *Jos? Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Director of R&D On Mon, Jul 24, 2017 at 10:10 PM, ?ric Pailleau wrote: > Dbgi. Sorry for typo. > > > Le 24 juil. 2017 10:09 PM, ?ric Pailleau a > ?crit : > > Hi, > I found two new chunks in 20.0: > > AtU8 and Dbdi. > > Regards > > Le 24 juil. 2017 10:00 PM, ?ric Pailleau a > ?crit : > > Hi, > invalid_chunk is maybe related to UTF8 atom chunk added in beam format > starting 20.0. > > I needed to change match clauses myself for my geas project. > > Regards > > > Le 24 juil. 2017 8:42 PM, Vlad Dumitrescu a ?crit : > > Hi! > > I have a project that gives me headache: on one machine, running "rebar3 > test" results in an error like below. Same code on another machine compiles > fine, but as far as I can tell the machines should be configured the same > way. Obviously, they aren't. Anyone has a suggestion how to find what is > going on? The code is compiled with OTP 17, so it shouldn't be related to > the recent beam chunk changes in v20... > > best regards, > Vlad > > ===> erlopts [debug_info, > {d,'EUNIT'}, > nowarn_missing_spec,warn_deprecated_function, > warn_export_all,warn_export_v > ars,warn_obsolete_guard, > warn_shadow_vars,warn_unused_function, > warn_unused_import,warn_unused_record, > warn_unused_vars,warnings_as_errors, > {d,'TEST'}] > ===> files to compile ["/home/vlad/projects/erlide_k > ernel/common/_build/test/lib/erlide_tools/src/runtime_tools_sup.erl", > "/home/vlad/projects/erlide_kernel/common/_build/test/lib/er > lide_tools/src/ttbe.erl", > ...., > "/home/vlad/projects/erlide_kernel/common/_build/test/lib/er > lide_tools/src/erlide_tools_app.erl"] > ===> Compiled runtime_tools_sup.erl > ===> Compiled ttbe.erl > ===> Compiled erlide_tools_app.erl > ===> cover compiling "/home/vlad/projects/erlide_ke > rnel/common/_build/test/lib/erlide_tools/ebin" > > =ERROR REPORT==== 24-Jul-2017::19:32:04 === > Error in process <0.395.0> with exit value: {{case_clause,{error,beam_lib, > {invalid_chunk,"/home/vlad/projects/erlide_kernel/common/_ > build/test/lib/erlide_tools/ebin/ttbe.beam","Abst"}}},[{cove > r,do_compile_beam,3,[{file,"cover.erl"},{line,1355}]},{ > cover,main_process_loop... > > ===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or > consult rebar3.crashdump > ===> Uncaught error: {case_clause, > {'EXIT', > {{case_clause, > {error,beam_lib, > {invalid_chunk, > "/home/vlad/projects/erlide_ke > rnel/common/_build/test/lib/erlide_tools/ebin/ttbe.beam", > "Abst"}}}, > [{cover,do_compile_beam,3, > [{file,"cover.erl"},{line,1355}]}, > {cover,main_process_loop,1, > [{file,"cover.erl"},{line,600}]}]}}} > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vladdu55@REDACTED Mon Jul 24 22:40:33 2017 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Mon, 24 Jul 2017 22:40:33 +0200 Subject: [erlang-questions] Trouble with abstract code, cover and rebar3 In-Reply-To: References: <60b4716d-6f0d-48e2-9ff2-7d9b6e7a44a2@email.android.com> Message-ID: Hi, 2> beam_lib:chunks("/home/vlad/projects/erlide_kernel/common/ _build/test/lib/erlide_tools/ebin/ttbe.beam", ["Abst"]). {ok,{ttbe,[{"Abst", <<131,80,0,1,222,78,120,156,181,125,7,148,84,69,214, 240,76,119,207,12,89,69,...>>}]}} So the chunk is there... regards, Vlad On Mon, Jul 24, 2017 at 10:23 PM, Jos? Valim < jose.valim@REDACTED> wrote: > The error message says the invalid chunk is the "Abst" chunk. > > Maybe try checking out if the chunk can be read manually? > > beam_lib:chunks("/home/vlad/projects/erlide_kernel/common/_ > build/test/lib/erlide_tools/ebin/ttbe.beam", ["Abst"]). > > > And also: > > beam_lib:chunks("/home/vlad/projects/erlide_kernel/common/_ > build/test/lib/erlide_tools/ebin/ttbe.beam", [abstract_code]). > > > And if you are running on OTP 20: > > beam_lib:chunks("/home/vlad/projects/erlide_kernel/common/_ > build/test/lib/erlide_tools/ebin/ttbe.beam", [debug_info]). > > > > *Jos? Valim* > www.plataformatec.com.br > Skype: jv.ptec > Founder and Director of R&D > > On Mon, Jul 24, 2017 at 10:10 PM, ?ric Pailleau > wrote: > >> Dbgi. Sorry for typo. >> >> >> Le 24 juil. 2017 10:09 PM, ?ric Pailleau a >> ?crit : >> >> Hi, >> I found two new chunks in 20.0: >> >> AtU8 and Dbdi. >> >> Regards >> >> Le 24 juil. 2017 10:00 PM, ?ric Pailleau a >> ?crit : >> >> Hi, >> invalid_chunk is maybe related to UTF8 atom chunk added in beam format >> starting 20.0. >> >> I needed to change match clauses myself for my geas project. >> >> Regards >> >> >> Le 24 juil. 2017 8:42 PM, Vlad Dumitrescu a ?crit : >> >> Hi! >> >> I have a project that gives me headache: on one machine, running "rebar3 >> test" results in an error like below. Same code on another machine compiles >> fine, but as far as I can tell the machines should be configured the same >> way. Obviously, they aren't. Anyone has a suggestion how to find what is >> going on? The code is compiled with OTP 17, so it shouldn't be related to >> the recent beam chunk changes in v20... >> >> best regards, >> Vlad >> >> ===> erlopts [debug_info, >> {d,'EUNIT'}, >> nowarn_missing_spec,warn_deprecated_function, >> warn_export_all,warn_export_v >> ars,warn_obsolete_guard, >> warn_shadow_vars,warn_unused_function, >> warn_unused_import,warn_unused_record, >> warn_unused_vars,warnings_as_errors, >> {d,'TEST'}] >> ===> files to compile ["/home/vlad/projects/erlide_k >> ernel/common/_build/test/lib/erlide_tools/src/runtime_tools_sup.erl", >> "/home/vlad/projects/erlide_kernel/common/_build/test/lib/er >> lide_tools/src/ttbe.erl", >> ...., >> "/home/vlad/projects/erlide_kernel/common/_build/test/lib/er >> lide_tools/src/erlide_tools_app.erl"] >> ===> Compiled runtime_tools_sup.erl >> ===> Compiled ttbe.erl >> ===> Compiled erlide_tools_app.erl >> ===> cover compiling "/home/vlad/projects/erlide_ke >> rnel/common/_build/test/lib/erlide_tools/ebin" >> >> =ERROR REPORT==== 24-Jul-2017::19:32:04 === >> Error in process <0.395.0> with exit value: {{case_clause,{error,beam_lib, >> {invalid_chunk,"/home/vlad/projects/erlide_kernel/common/_bu >> ild/test/lib/erlide_tools/ebin/ttbe.beam","Abst"}}},[{cover, >> do_compile_beam,3,[{file,"cover.erl"},{line,1355}]},{cover, >> main_process_loop... >> >> ===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or >> consult rebar3.crashdump >> ===> Uncaught error: {case_clause, >> {'EXIT', >> {{case_clause, >> {error,beam_lib, >> {invalid_chunk, >> "/home/vlad/projects/erlide_ke >> rnel/common/_build/test/lib/erlide_tools/ebin/ttbe.beam", >> "Abst"}}}, >> [{cover,do_compile_beam,3, >> [{file,"cover.erl"},{line,1355}]}, >> {cover,main_process_loop,1, >> [{file,"cover.erl"},{line,600}]}]}}} >> >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdl.web@REDACTED Tue Jul 25 04:34:30 2017 From: sdl.web@REDACTED (Leo Liu) Date: Tue, 25 Jul 2017 10:34:30 +0800 Subject: [erlang-questions] [ANN] Cowboy 2.0.0-rc.1 References: Message-ID: On 2017-07-24 17:27 +0200, Lo?c Hoguin wrote: > Cowboy 2.0.0-rc.1 has been released! > > https://ninenines.eu/articles/cowboy-2.0.0-rc.1/ > > Full details in the migration guide: > > https://ninenines.eu/docs/en/cowboy/2.0/guide/migrating_from_1.0/ > > Enjoy! ?? From jean.parpaillon@REDACTED Tue Jul 25 12:41:53 2017 From: jean.parpaillon@REDACTED (Jean Parpaillon) Date: Tue, 25 Jul 2017 12:41:53 +0200 Subject: [erlang-questions] SSH 4.5 bug ? Message-ID: <1500979313.13455.1.camel@free.fr> Hi all, Sorry if this question has already been raised but I couldn't get any information... I've written an ssh-based application with OTP. I'm using rsa keys for authentication. ssh version: $ ssh -V OpenSSH_7.5p1 Debian-5, OpenSSL 1.0.2l??25 May 2017 With elixir 1.4.5 / erlang 18.3, the application works fine. With elixir 1.4.5 / erlang 20.0 (Debian package from Erlang Solutions), authentication fails with 'Permission denied (publickey)'. The failing call trace: ssh_auth:handle_userauth_request/1 ssh_transport:verify/4 public_key:verify/4 crypto:verify/5 -> returns false I've seen potential incompatibilites in http://erlang.org/doc/apps/ssh/ notes.html I suppose using recent ssh client, negotation should avoid incompatibilites... Any idea ? Known bug ?? Thank you for your help ! Here is the trace from SSH connection: $ ssh -p 10022 -v localhost OpenSSH_7.5p1 Debian-5, OpenSSL 1.0.2l??25 May 2017 debug1: Reading configuration data /home/jean/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug1: Connecting to localhost [::1] port 10022. debug1: connect to address ::1 port 10022: Connection refused debug1: Connecting to localhost [127.0.0.1] port 10022. debug1: Connection established. debug1: identity file /home/jean/.ssh/id_rsa type 1 debug1: key_load_public: No such file or directory debug1: identity file /home/jean/.ssh/id_rsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/jean/.ssh/id_dsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/jean/.ssh/id_dsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/jean/.ssh/id_ecdsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/jean/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/jean/.ssh/id_ed25519 type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/jean/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_7.5p1 Debian-5 debug1: Remote protocol version 2.0, remote software version Mingus Orchestrator debug1: no match: Mingus Orchestrator debug1: Authenticating to localhost:10022 as 'jean' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: ecdh-sha2-nistp256 debug1: kex: host key algorithm: ecdsa-sha2-nistp256 debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none debug1: sending SSH2_MSG_KEX_ECDH_INIT debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ecdsa-sha2-nistp256 SHA256:/Yf6jxsGavhDvq5XRwjdG6sgLT3o2Xs06d63lhXWRjg debug1: Host '[localhost]:10022' is known and matches the ECDSA host key. debug1: Found key in /home/jean/.ssh/known_hosts:895 debug1: rekey after 4294967296 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey after 4294967296 blocks debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs= debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: /home/jean/.ssh/id_rsa debug1: Server accepts key: pkalg rsa-sha2-512 blen 277 debug1: Authentications that can continue: publickey debug1: Offering RSA public key: jean@REDACTED debug1: Authentications that can continue: publickey debug1: Trying private key: /home/jean/.ssh/id_dsa debug1: Trying private key: /home/jean/.ssh/id_ecdsa debug1: Trying private key: /home/jean/.ssh/id_ed25519 debug1: No more authentication methods to try. Permission denied (publickey). --? Jean Parpaillon -- Senior Developper @ KBRW Adventure Chairman @ OW2 Consortium -- Phone: +33 6 30 10 92 86 im: jean.parpaillon@REDACTED skype: jean.parpaillon linkedin: http://www.linkedin.com/in/jeanparpaillon/en -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Tue Jul 25 18:29:45 2017 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 25 Jul 2017 19:29:45 +0300 Subject: [erlang-questions] [ANN] Cowboy 2.0.0-rc.1 In-Reply-To: References: Message-ID: Hi. Recommended for production? Do you think that we should await any performance/latency changes from cowboy 1 to 2 on 2-4 RPS, about 10 Gbit/s per server? -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Tue Jul 25 18:53:16 2017 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Tue, 25 Jul 2017 18:53:16 +0200 Subject: [erlang-questions] [ANN] Cowboy 2.0.0-rc.1 In-Reply-To: References: Message-ID: <34b49b9e-ea73-e421-d15a-2bab62446596@ninenines.eu> Hello, Some people already use it in production without problems. Your mileage may vary. The performance/latency should be the same on the stream handler level (low level interface), but by default Cowboy 2.0 creates a new process per request and therefore there will be some performance loss due to the communication between the processes. There is more than one process per connection now because HTTP/2 streams (request/response pairs) must execute concurrently. But nothing prevents you from making your own interface that only uses one process per connection, just make sure not to block. Cheers, On 07/25/2017 06:29 PM, Max Lapshin wrote: > Hi. > > Recommended for production? > > Do you think that we should await any performance/latency changes from > cowboy 1 to 2 on 2-4 RPS, about 10 Gbit/s per server? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin https://ninenines.eu From vances@REDACTED Wed Jul 26 05:35:02 2017 From: vances@REDACTED (Vance Shipley) Date: Wed, 26 Jul 2017 09:05:02 +0530 Subject: [erlang-questions] Is a supervisor necessary here/when should I use one? In-Reply-To: <9EED6678-42DE-4603-B2A0-37FA01266A16@gmail.com> References: <9EED6678-42DE-4603-B2A0-37FA01266A16@gmail.com> Message-ID: On Sat, Jul 22, 2017 at 1:05 AM, code wiget wrote: > So, when I enable the plugin and the supervisor starts, my startup() function is run properly, but exits and error text is displayed after completing properly because the worker is not, well, doing anything until it is started to be called. I always start with a proper supervision hierarchy for all processes following the old Erlang adage "optimize last, if ever". It's true that with high frequency starting of children supervision introduces an overhead which could be a significant portion of overall load/latency however the stability provided should not be underestimated. In these cases you will want to configure the sasl application to suppress printing progress reports which would otherwise make the console/logs unusable so add this to your sys.config file: {sasl, [{errlog_type, error}]} > Conceptually, I am new to this. Is there any place for a supervisor here? IMHO there is always a use for supervision. One thing I pay attention to is what happens when you perform an orderly shutdown. Start your application and sasl then type "q()." in the console and you should get a silent exit within four seconds (typically). If you get reams of reports or hang a long time things aren't stable. -- -Vance From pablo.platt@REDACTED Wed Jul 26 18:20:36 2017 From: pablo.platt@REDACTED (pablo platt) Date: Wed, 26 Jul 2017 19:20:36 +0300 Subject: [erlang-questions] [ANN] Cowboy 2.0.0-rc.1 In-Reply-To: <34b49b9e-ea73-e421-d15a-2bab62446596@ninenines.eu> References: <34b49b9e-ea73-e421-d15a-2bab62446596@ninenines.eu> Message-ID: Does Cowboy 2.0 use process per Websocket packet? Does this means that it's better to stay with Cowboy 1.x for a server that use only Websockets? On Tue, Jul 25, 2017 at 7:53 PM, Lo?c Hoguin wrote: > Hello, > > Some people already use it in production without problems. Your mileage > may vary. > > The performance/latency should be the same on the stream handler level > (low level interface), but by default Cowboy 2.0 creates a new process per > request and therefore there will be some performance loss due to the > communication between the processes. > > There is more than one process per connection now because HTTP/2 streams > (request/response pairs) must execute concurrently. But nothing prevents > you from making your own interface that only uses one process per > connection, just make sure not to block. > > Cheers, > > > On 07/25/2017 06:29 PM, Max Lapshin wrote: > >> Hi. >> >> Recommended for production? >> >> Do you think that we should await any performance/latency changes from >> cowboy 1 to 2 on 2-4 RPS, about 10 Gbit/s per server? >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- > Lo?c Hoguin > https://ninenines.eu > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Wed Jul 26 18:25:21 2017 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Wed, 26 Jul 2017 18:25:21 +0200 Subject: [erlang-questions] [ANN] Cowboy 2.0.0-rc.1 In-Reply-To: References: <34b49b9e-ea73-e421-d15a-2bab62446596@ninenines.eu> Message-ID: The Websocket handler takes over the connection process so it'll become 1 process per connection after the upgrade to Websocket. On 07/26/2017 06:20 PM, pablo platt wrote: > Does Cowboy 2.0 use process per Websocket packet? > Does this means that it's better to stay with Cowboy 1.x for a server > that use only Websockets? > > On Tue, Jul 25, 2017 at 7:53 PM, Lo?c Hoguin > wrote: > > Hello, > > Some people already use it in production without problems. Your > mileage may vary. > > The performance/latency should be the same on the stream handler > level (low level interface), but by default Cowboy 2.0 creates a new > process per request and therefore there will be some performance > loss due to the communication between the processes. > > There is more than one process per connection now because HTTP/2 > streams (request/response pairs) must execute concurrently. But > nothing prevents you from making your own interface that only uses > one process per connection, just make sure not to block. > > Cheers, > > > On 07/25/2017 06:29 PM, Max Lapshin wrote: > > Hi. > > Recommended for production? > > Do you think that we should await any performance/latency > changes from cowboy 1 to 2 on 2-4 RPS, about 10 Gbit/s per server? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > Lo?c Hoguin > https://ninenines.eu > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > -- Lo?c Hoguin https://ninenines.eu From max.lapshin@REDACTED Wed Jul 26 19:17:33 2017 From: max.lapshin@REDACTED (Max Lapshin) Date: Wed, 26 Jul 2017 20:17:33 +0300 Subject: [erlang-questions] erlang 20.0, macos 10.11, crash Message-ID: Running erlang 20.0: beam/erl_port.h:769: Lock check assertion "erts_lc_is_port_locked(prt) || ((int) (SWord) erts_tsd_get(erts_is_crash_dumping_key))" failed! Currently no locks are locked by the unknown thread. just on start of program. Compiled with: ./configure --prefix=/usr/local/Cellar/erlang/19.0 --enable-threads --enable-dirty-schedulers --enable-smp-support --enable-kernel-poll --enable-m64-build --with-dynamic-trace=dtrace --without-javac --with-ssl --with-wx --with-ssl=/usr/local/Cellar/openssl/1.0.2 --with-microstate-accounting=extra --enable-hipe --enable-lock-counter Is it a known problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Wed Jul 26 19:45:48 2017 From: erlang@REDACTED (Joe Armstrong) Date: Wed, 26 Jul 2017 19:45:48 +0200 Subject: [erlang-questions] My quest for a decent way to make a GUI in erlang Message-ID: More on my search for a good (understandable) GUI engine... I've spent the last few weeks botanising through various GUI/graphics construction kits - and goodness what a mess. I thought I'd share some of my experiences and see if it resonates with anybody. 1) Gui building is an (almost) total mess - I say almost because there is some good software around - but the good stuff tends to be experimental, undocumented and difficult to use. 2) The most popular frameworks are bloated, difficult to use and impossible to understand without significant effort. 3) wxWidgets and the Erlang port wxErlang is usable - but the documentation assumes you are familiar with the wxWidgets way of doing things and with OO callback programming - which is *very* Un-Erlang way of thinking 4) The use of interface builders (Xcode, etc.) is a symptom of problem. GUI codes gets so messy that it is virtually impossible to write "by hand" - so enter the GUI builder - this is basically giving up on the idea that GUIs can be written in a clear and simple manner by hand. 5) In the late 1970 - mid 80's there were several GUI languages and systems that were easy to use and easy to program. For example Smalltalk, TCL, Visual basic, Borland Turbo Graphics Is there any good stuff around today? Surprisingly the answer is yes - but the code is difficult to find not supported and not mainstream. First a couple of papers that you might find interesting: + http://www.eugenkiss.com/projects/thesis.pdf and https://github.com/eugenkiss/7guis/wiki The author solves 7 different problems with a number of different GUI's + http://blog.johnnovak.net/2016/05/29/cross-platform-gui-trainwreck-2016-edition/ A great read - This blog has a lot of good information about the techniques used to build several state of the art GUIs (for example Reaper, Blender, Light table) so If you've every wondered how fancy GUIs work this article gives several clues. It also has the rather nice example of a GUI written using the Electron Framework that made an 189 MB executable to bang up a window with a small number of controls in it. There's a list of references in one of the comments to this blog that lead to several interesting *small'ish GUIs' Good stuff I did find some good software and some potentially very good software. My top picks are as follows: http://inscore.sourceforge.net/ This is my favorite from an architectural POV. It is controlled entirely by sending it messages. Not a single callback to be seen https://github.com/andlabs/libui This looks very promising - it's a cross platform adaption layer with a C interface - I've only build it on a Mac but the adaption layer looks pretty easy to use. There's a C interface that could be adapted to Erlang. There are very few examples https://github.com/andlabs/ui/wiki/Getting-Started has a go example - but if you download and build the system the C examples are easy to follow. http://www.red-lang.org/ Is amazing - Red is a language inspired by REBOL. REBOL never achieved much popularity - perhaps Red will. Once you've see red you'll wonder why you program in anything else (there are good reasons - but for simply desktop apps Red is great). https://github.com/wjakob/nanogui Restores my faith in programming - it's small and built on top of https://github.com/memononen/NanoVG NanoVG is basically a canvas type interface to OpenGL Reading the NanoGui code made me wonder if the best way to make a GUI for erlang would be to use OpenGL for the low-level stuff and do all the rest in Erlang. Buttons etc. are pretty easy to define as processes which I believe is the way http://www.wings3d.com/ did things. The future I'm still undecided - one of more of the following seem attractive 1) wxErlang - it works *but* it's big and ugly and has a nasty programming model 2) An interface to Red would be great - but red is pretty unknown 3) libui looks promising - anybody interested in this? 4) the nanogui/NanoVG track looks good - anything with nano in the name has my vote 5) The inscore architecture rules - NO CALLBACKS - Yea Verily verily I say unto you - "useth not the callback, even though they that useth the callback are ignited with a great passion and extol the virtues of the callback - for therein lies the madness that do come when the callback faileth for reasons not comprehended' Thus it is writ. Cheers /Joe From sverker.eriksson@REDACTED Wed Jul 26 20:06:26 2017 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Wed, 26 Jul 2017 20:06:26 +0200 Subject: [erlang-questions] erlang 20.0, macos 10.11, crash In-Reply-To: References: Message-ID: <86b12637-0625-2fc9-879c-f6df356fcb63@ericsson.com> That assertion should only be executed if configured with --enable-lock-checking or if you build and run the debug VM. Did you clean the source tree before build (git clean -xfd)? /Sverker On 07/26/2017 07:17 PM, Max Lapshin wrote: > Running erlang 20.0: > > beam/erl_port.h:769: Lock check assertion "erts_lc_is_port_locked(prt) || > ((int) (SWord) erts_tsd_get(erts_is_crash_dumping_key))" failed! > > Currently no locks are locked by the unknown thread. > > > just on start of program. > > Compiled with: > > > ./configure --prefix=/usr/local/Cellar/erlang/19.0 --enable-threads > --enable-dirty-schedulers --enable-smp-support --enable-kernel-poll > --enable-m64-build --with-dynamic-trace=dtrace --without-javac --with-ssl > --with-wx --with-ssl=/usr/local/Cellar/openssl/1.0.2 > --with-microstate-accounting=extra --enable-hipe --enable-lock-counter > > > Is it a known problem? > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Wed Jul 26 20:52:35 2017 From: lloyd@REDACTED (lloyd@REDACTED) Date: Wed, 26 Jul 2017 14:52:35 -0400 (EDT) Subject: [erlang-questions] My quest for a decent way to make a GUI in erlang In-Reply-To: References: Message-ID: <1501095155.876616807@apps.rackspace.com> Hi Joe, Outstanding research! I've been flailing around a similar problem with dim lights of success here and there. We all know that there are issues with your long-in-the-tooth erlguten library. I've pulled out the font management and copy-fitting routines, made slight modifications, and have been building up a page-layout program. At the moment I'm focusing on PDF, but many underlying concepts apply to HTML and desktop GUIs as well. So first thing I'd note, is that you may be dealing with an even more general problem than you think-- e.g. how to display content in a 2D space for most effective communication of intent between content creator and consumer. In the case of GUIs, the roles of content creator and consumer shift back and forth like a ping pong game. Print graphic designers have long experience and established techniques for approaching the problem. They first divide the 2D space into a page grid--- essentially a composition of boxes. You'll find many approaches and theories of how best to design page grids on the web. Turns our that boxes can be comprehensively represented as maps in Erlang. Taken a step further, no reason why a box can't be moved, re dimensioned, scaled, etc., in an Erlang process. Box parameters include xy position of upper-left corner in the 2D space, width, height, and various other application-specific parameters--- borders, background color/image, content, etc. With this thought in mind, I've been working on a box language to efficiently define a page grid in Erlang. What I have works, but no doubt can be improved and optimized. Next thought is what goes into each box in the page grid--- text, images, graphics, Erlang functions... Hey, "widgets" if you will. Most all of this can be abstractly defined without regard to media--- print or video. Box mind-set can be focused down on widgets. A widget is a composition of visual elements in a contained space. Visual elements include text, icons, boxes, etc. Text and icons can be abstractly represented as boxes. Boxes all the way down. So, my fantasy--- 1. Perfect the box language--- may be two versions: a) text description; b) point, click, and drag 2. Perfect an abstract language to define content elements 3. Define the base visual/functional elements of the content language 4. Develop libraries of base elements for both print and video display If we're smart and shrewd, we end up with an efficient way to generate both print and video display pages in a common language that effectively communicates intent. I know that this is all warmed-over-soup. Just watch a handful of TV commercials to see how effectively graphic designers convey intent in 2D spaces or consider the communication issues in 3D CAD programs and how they've been resolved. But I want to do it in Erlang and am currently working in my clumsy way to do so. All the best, Lloyd -----Original Message----- From: "Joe Armstrong" Sent: Wednesday, July 26, 2017 1:45pm To: "Erlang" Subject: [erlang-questions] My quest for a decent way to make a GUI in erlang More on my search for a good (understandable) GUI engine... I've spent the last few weeks botanising through various GUI/graphics construction kits - and goodness what a mess. I thought I'd share some of my experiences and see if it resonates with anybody. 1) Gui building is an (almost) total mess - I say almost because there is some good software around - but the good stuff tends to be experimental, undocumented and difficult to use. 2) The most popular frameworks are bloated, difficult to use and impossible to understand without significant effort. 3) wxWidgets and the Erlang port wxErlang is usable - but the documentation assumes you are familiar with the wxWidgets way of doing things and with OO callback programming - which is *very* Un-Erlang way of thinking 4) The use of interface builders (Xcode, etc.) is a symptom of problem. GUI codes gets so messy that it is virtually impossible to write "by hand" - so enter the GUI builder - this is basically giving up on the idea that GUIs can be written in a clear and simple manner by hand. 5) In the late 1970 - mid 80's there were several GUI languages and systems that were easy to use and easy to program. For example Smalltalk, TCL, Visual basic, Borland Turbo Graphics Is there any good stuff around today? Surprisingly the answer is yes - but the code is difficult to find not supported and not mainstream. First a couple of papers that you might find interesting: + http://www.eugenkiss.com/projects/thesis.pdf and https://github.com/eugenkiss/7guis/wiki The author solves 7 different problems with a number of different GUI's + http://blog.johnnovak.net/2016/05/29/cross-platform-gui-trainwreck-2016-edition/ A great read - This blog has a lot of good information about the techniques used to build several state of the art GUIs (for example Reaper, Blender, Light table) so If you've every wondered how fancy GUIs work this article gives several clues. It also has the rather nice example of a GUI written using the Electron Framework that made an 189 MB executable to bang up a window with a small number of controls in it. There's a list of references in one of the comments to this blog that lead to several interesting *small'ish GUIs' Good stuff I did find some good software and some potentially very good software. My top picks are as follows: http://inscore.sourceforge.net/ This is my favorite from an architectural POV. It is controlled entirely by sending it messages. Not a single callback to be seen https://github.com/andlabs/libui This looks very promising - it's a cross platform adaption layer with a C interface - I've only build it on a Mac but the adaption layer looks pretty easy to use. There's a C interface that could be adapted to Erlang. There are very few examples https://github.com/andlabs/ui/wiki/Getting-Started has a go example - but if you download and build the system the C examples are easy to follow. http://www.red-lang.org/ Is amazing - Red is a language inspired by REBOL. REBOL never achieved much popularity - perhaps Red will. Once you've see red you'll wonder why you program in anything else (there are good reasons - but for simply desktop apps Red is great). https://github.com/wjakob/nanogui Restores my faith in programming - it's small and built on top of https://github.com/memononen/NanoVG NanoVG is basically a canvas type interface to OpenGL Reading the NanoGui code made me wonder if the best way to make a GUI for erlang would be to use OpenGL for the low-level stuff and do all the rest in Erlang. Buttons etc. are pretty easy to define as processes which I believe is the way http://www.wings3d.com/ did things. The future I'm still undecided - one of more of the following seem attractive 1) wxErlang - it works *but* it's big and ugly and has a nasty programming model 2) An interface to Red would be great - but red is pretty unknown 3) libui looks promising - anybody interested in this? 4) the nanogui/NanoVG track looks good - anything with nano in the name has my vote 5) The inscore architecture rules - NO CALLBACKS - Yea Verily verily I say unto you - "useth not the callback, even though they that useth the callback are ignited with a great passion and extol the virtues of the callback - for therein lies the madness that do come when the callback faileth for reasons not comprehended' Thus it is writ. Cheers /Joe _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From dszoboszlay@REDACTED Wed Jul 26 21:27:48 2017 From: dszoboszlay@REDACTED (=?UTF-8?Q?D=C3=A1niel_Szoboszlay?=) Date: Wed, 26 Jul 2017 19:27:48 +0000 Subject: [erlang-questions] os:cmd hang on OTP 18 Message-ID: Hi, I've encountered a strange problem with os:cmd when running tar and lbzip2. Steps to reproduce: # create some lbzip2 compressed data dd if=/dev/urandom of=/tmp/testfile count=10 tar -cf - -C /tmp testfile | lbzip2 -6 -n 4 | dd of=/tmp/tartest status=none # try to extract the archive from Erlang with os:cmd erl -noinput -eval 'os:cmd("tar -C /tmp/ -xf /tmp/tartest --use-compress-program=lbzip2"), init:stop().' This worked fine with OTP 17.5.6.7, but with OTP 18.3.4.5 the command hangs: lbzip2 just sits in a rt_sigsuspend syscall waiting for a USR2, PIPE or XFSZ signal. And its parent, the tar process waits in a wait4 syscall for lbzip2 to terminate. I don't have at the moment any newer OTP version installed, I'm not sure how OTP 19 or 20 would behave. I tried to strace the processes, but there's too much noise, I couldn't yet figure out anything interesting there. I also tried to diff OTP 17 & 18, but os:cmd/1 and friends didn't change. I'm not sure about the port code, but at least the release notes didn't mention anything major. Or did I miss something? Does anyone have an idea what may have changed between these OTP versions? Thanks, Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmytro.lytovchenko@REDACTED Wed Jul 26 21:34:16 2017 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Wed, 26 Jul 2017 21:34:16 +0200 Subject: [erlang-questions] os:cmd hang on OTP 18 In-Reply-To: References: Message-ID: Is it something lbzip2 related? Did you try normal single-thread bzip2? (-j flag or --bzip2) What is you use gzip? (-z or --gzip) 2017-07-26 21:27 GMT+02:00 D?niel Szoboszlay : > Hi, > > I've encountered a strange problem with os:cmd when running tar and > lbzip2. Steps to reproduce: > > # create some lbzip2 compressed data > > dd if=/dev/urandom of=/tmp/testfile count=10 > tar -cf - -C /tmp testfile | lbzip2 -6 -n 4 | dd of=/tmp/tartest status=none > > > # try to extract the archive from Erlang with os:cmd > > erl -noinput -eval 'os:cmd("tar -C /tmp/ -xf /tmp/tartest --use-compress-program=lbzip2"), init:stop().' > > > This worked fine with OTP 17.5.6.7, but with OTP 18.3.4.5 the command > hangs: lbzip2 just sits in a rt_sigsuspend syscall waiting for a USR2, PIPE > or XFSZ signal. And its parent, the tar process waits in a wait4 syscall > for lbzip2 to terminate. > > I don't have at the moment any newer OTP version installed, I'm not sure > how OTP 19 or 20 would behave. > > I tried to strace the processes, but there's too much noise, I couldn't > yet figure out anything interesting there. > > I also tried to diff OTP 17 & 18, but os:cmd/1 and friends didn't change. > I'm not sure about the port code, but at least the release notes didn't > mention anything major. Or did I miss something? Does anyone have an idea > what may have changed between these OTP versions? > > Thanks, > Daniel > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dszoboszlay@REDACTED Wed Jul 26 21:47:57 2017 From: dszoboszlay@REDACTED (=?UTF-8?Q?D=C3=A1niel_Szoboszlay?=) Date: Wed, 26 Jul 2017 19:47:57 +0000 Subject: [erlang-questions] os:cmd hang on OTP 18 In-Reply-To: References: Message-ID: Honestly, I didn't try with other command variations. There are many commands that do not hang when run from os:cmd, regardless of the OTP version. But this particular command does hang with one OTP version, and not with the other OTP version. So the difference is in OTP, and I want to find out what has changed. Daniel On Wed, 26 Jul 2017 at 21:34 Dmytro Lytovchenko < dmytro.lytovchenko@REDACTED> wrote: > Is it something lbzip2 related? > Did you try normal single-thread bzip2? (-j flag or --bzip2) > What is you use gzip? (-z or --gzip) > > 2017-07-26 21:27 GMT+02:00 D?niel Szoboszlay : > >> Hi, >> >> I've encountered a strange problem with os:cmd when running tar and >> lbzip2. Steps to reproduce: >> >> # create some lbzip2 compressed data >> >> dd if=/dev/urandom of=/tmp/testfile count=10 >> tar -cf - -C /tmp testfile | lbzip2 -6 -n 4 | dd of=/tmp/tartest status=none >> >> >> # try to extract the archive from Erlang with os:cmd >> >> erl -noinput -eval 'os:cmd("tar -C /tmp/ -xf /tmp/tartest --use-compress-program=lbzip2"), init:stop().' >> >> >> This worked fine with OTP 17.5.6.7, but with OTP 18.3.4.5 the command >> hangs: lbzip2 just sits in a rt_sigsuspend syscall waiting for a USR2, PIPE >> or XFSZ signal. And its parent, the tar process waits in a wait4 syscall >> for lbzip2 to terminate. >> >> I don't have at the moment any newer OTP version installed, I'm not sure >> how OTP 19 or 20 would behave. >> >> I tried to strace the processes, but there's too much noise, I couldn't >> yet figure out anything interesting there. >> >> I also tried to diff OTP 17 & 18, but os:cmd/1 and friends didn't change. >> I'm not sure about the port code, but at least the release notes didn't >> mention anything major. Or did I miss something? Does anyone have an idea >> what may have changed between these OTP versions? >> >> Thanks, >> Daniel >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From codewiget95@REDACTED Wed Jul 26 21:37:01 2017 From: codewiget95@REDACTED (code wiget) Date: Wed, 26 Jul 2017 15:37:01 -0400 Subject: [erlang-questions] Node not active but is connected Message-ID: <8A4DB46B-ACF7-4D7B-AFE6-B462C727B3E2@gmail.com> Hello, For background, right now I have two instances of emqtt running on two separate computers on the same network. I have written an Erlang program to create an mnesia instance and a shared table between them, as I need to be able to access an important key value store from both instances. The problem is that I can use net_kernel:connect_node(?emqttd@REDACTED?). to connect the nodes, which is successful, but then when I try to use amnesia:create table with disc copies on all of those nodes, I get an error that the nodes I am connecting to are not active. Below I will illustrate the flow: connect_all_nodes(Nodelist) nodes() is now = Nodelist mnesia:create_schema([node()]) ? create a scheme on the local, non-emqtt instance (cannot add other nodes as they have their own mnesia DB?s running) Start mnesia mnesia:Create_table(device, [{attributes, record_info(fields, device)}, {disc_copies, nodes()}, {type, set}]). ? this last command fails with the error:{aborted,{not_active,iot_device,?emqttd@REDACTED?}} ?How is it possible that my node thinks this device is not active if I have already connected the nodes, verified that nodes() has been populated, and I?ve even tested using net_admn ping and I get a pong. How do I get them to truly recognize each other? Thank you for your help! From albin.stigo@REDACTED Wed Jul 26 22:20:23 2017 From: albin.stigo@REDACTED (=?UTF-8?B?QWxiaW4gU3RpZ8O2?=) Date: Wed, 26 Jul 2017 22:20:23 +0200 Subject: [erlang-questions] My quest for a decent way to make a GUI in erlang In-Reply-To: References: Message-ID: Hi Joe, Nice research! Interesting list of software. I've used a lot of GUI libraries. My favorite is Cocoa/Xcode and QT is pretty good too. I like interface builders because you get instant visual feedback. Also IMHO the tricky part is not the initial layout of widgets but how to handle resizing. Interface builder in Xcode solves this with constraints. They have a learning curve but it works pretty well. For serious work you also have to consider i18n. Cocoa is good because you can build interfaces both programmatically and with interface builder, and you can combine the two approaches. Interface builder just serializes the object graph so they are essentially the same. I'd also say that a binding mechanism is essential to avoiding a lot of boilerplate code to keep the GUI updated. Cocoa has bindings (on osx) that's based on key value observing on (ios and osx). QT has signals and slots. --Albin On Wed, Jul 26, 2017 at 7:45 PM, Joe Armstrong wrote: > More on my search for a good (understandable) GUI engine... > > I've spent the last few weeks botanising through various > GUI/graphics construction kits - and goodness what a mess. > > I thought I'd share some of my experiences and see if > it resonates with anybody. > > 1) Gui building is an (almost) total mess - I say almost because > there is some good software around - but the good stuff tends to be > experimental, undocumented and difficult to use. > > 2) The most popular frameworks are bloated, difficult to use and > impossible to understand without significant effort. > > 3) wxWidgets and the Erlang port wxErlang is usable - but the > documentation assumes you are familiar with the wxWidgets way > of doing things and with OO callback programming - which is > *very* Un-Erlang way of thinking > > 4) The use of interface builders (Xcode, etc.) is a symptom of > problem. GUI codes gets so messy that it is virtually impossible > to write "by hand" - so enter the GUI builder - this is basically > giving up on the idea that GUIs can be written in a clear and > simple manner by hand. > > 5) In the late 1970 - mid 80's there were several GUI languages > and systems that were easy to use and easy to program. For > example Smalltalk, TCL, Visual basic, Borland Turbo Graphics > > Is there any good stuff around today? > > Surprisingly the answer is yes - but the code is difficult to find > not supported and not mainstream. > > First a couple of papers that you might find interesting: > > + http://www.eugenkiss.com/projects/thesis.pdf > and https://github.com/eugenkiss/7guis/wiki > > The author solves 7 different problems with a number of different > GUI's > > + http://blog.johnnovak.net/2016/05/29/cross-platform-gui-trainwreck-2016-edition/ > > A great read - This blog has a lot of good information about the techniques > used to build several state of the art GUIs (for example Reaper, > Blender, Light table) > so If you've every wondered how fancy GUIs work this article gives > several clues. > > It also has the rather nice example of a GUI written using the > Electron Framework > that made an 189 MB executable to bang up a window with a small number of > controls in it. > > There's a list of references in one of the comments to this blog that > lead to several interesting *small'ish GUIs' > > Good stuff > > I did find some good software and some potentially very good software. > My top picks are as follows: > > http://inscore.sourceforge.net/ > > This is my favorite from an architectural POV. > It is controlled entirely by sending it messages. > Not a single callback to be seen > > https://github.com/andlabs/libui > > This looks very promising - it's a cross platform adaption layer > with a C interface - I've only build it on a Mac but > the adaption layer looks pretty easy to use. There's a C interface > that could be adapted to Erlang. > > There are very few examples > https://github.com/andlabs/ui/wiki/Getting-Started > has a go example - but if you download and build the system the > C examples are easy to follow. > > http://www.red-lang.org/ > > Is amazing - Red is a language inspired by REBOL. > > REBOL never achieved much popularity - perhaps Red will. > Once you've see red you'll wonder why you program in anything else > (there are good reasons - but for simply desktop apps Red is great). > > https://github.com/wjakob/nanogui > > Restores my faith in programming - it's small and built on top > of https://github.com/memononen/NanoVG > > NanoVG is basically a canvas type interface to OpenGL > > Reading the NanoGui code made me wonder if the best way to make > a GUI for erlang would be to use OpenGL for the low-level stuff > and do all the rest in Erlang. > > Buttons etc. are pretty easy to define as processes which I believe > is the way http://www.wings3d.com/ did things. > > The future > > I'm still undecided - one of more of the following seem attractive > > 1) wxErlang - it works *but* it's big and ugly and has a nasty > programming model > 2) An interface to Red would be great - but red is pretty unknown > 3) libui looks promising - anybody interested in this? > 4) the nanogui/NanoVG track looks good - anything with nano in the > name has my vote > 5) The inscore architecture rules - NO CALLBACKS - Yea > > Verily verily I say unto you - "useth not the callback, even though > they that useth the callback are ignited with a great passion and > extol the virtues of the callback - for therein lies the madness > that do come when the callback faileth for reasons not comprehended' > > Thus it is writ. > > Cheers > > /Joe > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From erlang@REDACTED Wed Jul 26 22:57:48 2017 From: erlang@REDACTED (Joe Armstrong) Date: Wed, 26 Jul 2017 22:57:48 +0200 Subject: [erlang-questions] My quest for a decent way to make a GUI in erlang In-Reply-To: References: Message-ID: One other point that I omitted to make When I wrote ex11 (a graphics experiment) I realised that 3D objects with behaviour are *really* just 2-D objects + time. A button is just a rectangle with a shadow draw round it. When you click it it moves down and the shadow changes, a little while later it returns to its original position. I wanted to make a tabbed widget - now you might think that I could combine buttons in some kind of hbox - well yes you can but it looks terrible. No a tabbed widget viewed as a 2D drawing is "just" a line that moves up and down and a few shadows in the appropriate places. So the way to make a tabbed widget is *not* to compose a hbox of buttons but to draw the outline of what you want in 2D and make some regions that are sensitive to mouse clicks. The abstractions you think you need (buttons, sliders) are not the ones that are useful from a compositional point of view. This is actually why I like SVG - there are two abstractions path and group - path draws a curve. Group glues objects and has an optional affine transformation. All other SVG objects (rectangles, circles, lines, ...) can be constructed from paths and groups. Postscript is another *great* and not very well understood language - display postscript would be great for GUIs but which is sadly not used. It's crazy - in the browser it's really easy to mock up an interface with SVG or a canvas or by adding things to the DOM - but on the desktop it's a pain in the whatnot. The answer is *not* to bundle the entire browser into a stand alone app but to strip out the good parts and make a minimal system with only the good parts (which in my mind is *just* a drawing surface, can a canvas or SVG responsive widget) a small scripting language (say Lua or JS) and a communication method (say JSON) and transport mechanism (say TCP) This (of course) is what we do not do :-) - instead everything that has ever seen the light of day is bundled into the browser and the parts cannot be easily separated. Cheers /Joe On Wed, Jul 26, 2017 at 10:20 PM, Albin Stig? wrote: > Hi Joe, > > Nice research! Interesting list of software. > > I've used a lot of GUI libraries. My favorite is Cocoa/Xcode and QT is > pretty good too. > > I like interface builders because you get instant visual feedback. > Also IMHO the tricky part is not the initial layout of widgets but how > to handle resizing. Interface builder in Xcode solves this with > constraints. They have a learning curve but it works pretty well. For > serious work you also have to consider i18n. > > Cocoa is good because you can build interfaces both programmatically > and with interface builder, and you can combine the two approaches. > Interface builder just serializes the object graph so they are > essentially the same. > > I'd also say that a binding mechanism is essential to avoiding a lot > of boilerplate code to keep the GUI updated. Cocoa has bindings (on > osx) that's based on key value observing on (ios and osx). QT has > signals and slots. > > > --Albin > > > On Wed, Jul 26, 2017 at 7:45 PM, Joe Armstrong wrote: >> More on my search for a good (understandable) GUI engine... >> >> I've spent the last few weeks botanising through various >> GUI/graphics construction kits - and goodness what a mess. >> >> I thought I'd share some of my experiences and see if >> it resonates with anybody. >> >> 1) Gui building is an (almost) total mess - I say almost because >> there is some good software around - but the good stuff tends to be >> experimental, undocumented and difficult to use. >> >> 2) The most popular frameworks are bloated, difficult to use and >> impossible to understand without significant effort. >> >> 3) wxWidgets and the Erlang port wxErlang is usable - but the >> documentation assumes you are familiar with the wxWidgets way >> of doing things and with OO callback programming - which is >> *very* Un-Erlang way of thinking >> >> 4) The use of interface builders (Xcode, etc.) is a symptom of >> problem. GUI codes gets so messy that it is virtually impossible >> to write "by hand" - so enter the GUI builder - this is basically >> giving up on the idea that GUIs can be written in a clear and >> simple manner by hand. >> >> 5) In the late 1970 - mid 80's there were several GUI languages >> and systems that were easy to use and easy to program. For >> example Smalltalk, TCL, Visual basic, Borland Turbo Graphics >> >> Is there any good stuff around today? >> >> Surprisingly the answer is yes - but the code is difficult to find >> not supported and not mainstream. >> >> First a couple of papers that you might find interesting: >> >> + http://www.eugenkiss.com/projects/thesis.pdf >> and https://github.com/eugenkiss/7guis/wiki >> >> The author solves 7 different problems with a number of different >> GUI's >> >> + http://blog.johnnovak.net/2016/05/29/cross-platform-gui-trainwreck-2016-edition/ >> >> A great read - This blog has a lot of good information about the techniques >> used to build several state of the art GUIs (for example Reaper, >> Blender, Light table) >> so If you've every wondered how fancy GUIs work this article gives >> several clues. >> >> It also has the rather nice example of a GUI written using the >> Electron Framework >> that made an 189 MB executable to bang up a window with a small number of >> controls in it. >> >> There's a list of references in one of the comments to this blog that >> lead to several interesting *small'ish GUIs' >> >> Good stuff >> >> I did find some good software and some potentially very good software. >> My top picks are as follows: >> >> http://inscore.sourceforge.net/ >> >> This is my favorite from an architectural POV. >> It is controlled entirely by sending it messages. >> Not a single callback to be seen >> >> https://github.com/andlabs/libui >> >> This looks very promising - it's a cross platform adaption layer >> with a C interface - I've only build it on a Mac but >> the adaption layer looks pretty easy to use. There's a C interface >> that could be adapted to Erlang. >> >> There are very few examples >> https://github.com/andlabs/ui/wiki/Getting-Started >> has a go example - but if you download and build the system the >> C examples are easy to follow. >> >> http://www.red-lang.org/ >> >> Is amazing - Red is a language inspired by REBOL. >> >> REBOL never achieved much popularity - perhaps Red will. >> Once you've see red you'll wonder why you program in anything else >> (there are good reasons - but for simply desktop apps Red is great). >> >> https://github.com/wjakob/nanogui >> >> Restores my faith in programming - it's small and built on top >> of https://github.com/memononen/NanoVG >> >> NanoVG is basically a canvas type interface to OpenGL >> >> Reading the NanoGui code made me wonder if the best way to make >> a GUI for erlang would be to use OpenGL for the low-level stuff >> and do all the rest in Erlang. >> >> Buttons etc. are pretty easy to define as processes which I believe >> is the way http://www.wings3d.com/ did things. >> >> The future >> >> I'm still undecided - one of more of the following seem attractive >> >> 1) wxErlang - it works *but* it's big and ugly and has a nasty >> programming model >> 2) An interface to Red would be great - but red is pretty unknown >> 3) libui looks promising - anybody interested in this? >> 4) the nanogui/NanoVG track looks good - anything with nano in the >> name has my vote >> 5) The inscore architecture rules - NO CALLBACKS - Yea >> >> Verily verily I say unto you - "useth not the callback, even though >> they that useth the callback are ignited with a great passion and >> extol the virtues of the callback - for therein lies the madness >> that do come when the callback faileth for reasons not comprehended' >> >> Thus it is writ. >> >> Cheers >> >> /Joe >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From max.lapshin@REDACTED Wed Jul 26 23:33:07 2017 From: max.lapshin@REDACTED (Max Lapshin) Date: Thu, 27 Jul 2017 00:33:07 +0300 Subject: [erlang-questions] erlang 20.0, macos 10.11, crash In-Reply-To: <86b12637-0625-2fc9-879c-f6df356fcb63@ericsson.com> References: <86b12637-0625-2fc9-879c-f6df356fcb63@ericsson.com> Message-ID: yes, my shame. this was a build with --enable-lock-checking but is it ok that this assertion was broken? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmytro.lytovchenko@REDACTED Thu Jul 27 02:09:03 2017 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Thu, 27 Jul 2017 02:09:03 +0200 Subject: [erlang-questions] os:cmd hang on OTP 18 In-Reply-To: References: Message-ID: I could observe the behaviour only in R18, but not in R19 and not in R20 I also could not reproduce it in debug flavour of R18 emulator, but it reproduces reliably in release SMP variant. The changes to os.erl between 18.3.4.5 and 19.0 include removal of os:cmd server which might somehow be related (commit *200247f972b012ced0c4b2c6611f091af66ebedd*). This commit *possibly* fixes the behavior ? in R19 (build 19.0 by Kerl) the behaviour does not happen. 2017-07-26 21:47 GMT+02:00 D?niel Szoboszlay : > Honestly, I didn't try with other command variations. There are many > commands that do not hang when run from os:cmd, regardless of the OTP > version. But this particular command does hang with one OTP version, and > not with the other OTP version. So the difference is in OTP, and I want to > find out what has changed. > > Daniel > > On Wed, 26 Jul 2017 at 21:34 Dmytro Lytovchenko < > dmytro.lytovchenko@REDACTED> wrote: > >> Is it something lbzip2 related? >> Did you try normal single-thread bzip2? (-j flag or --bzip2) >> What is you use gzip? (-z or --gzip) >> >> 2017-07-26 21:27 GMT+02:00 D?niel Szoboszlay : >> >>> Hi, >>> >>> I've encountered a strange problem with os:cmd when running tar and >>> lbzip2. Steps to reproduce: >>> >>> # create some lbzip2 compressed data >>> >>> dd if=/dev/urandom of=/tmp/testfile count=10 >>> tar -cf - -C /tmp testfile | lbzip2 -6 -n 4 | dd of=/tmp/tartest status=none >>> >>> >>> # try to extract the archive from Erlang with os:cmd >>> >>> erl -noinput -eval 'os:cmd("tar -C /tmp/ -xf /tmp/tartest --use-compress-program=lbzip2"), init:stop().' >>> >>> >>> This worked fine with OTP 17.5.6.7, but with OTP 18.3.4.5 the command >>> hangs: lbzip2 just sits in a rt_sigsuspend syscall waiting for a USR2, PIPE >>> or XFSZ signal. And its parent, the tar process waits in a wait4 syscall >>> for lbzip2 to terminate. >>> >>> I don't have at the moment any newer OTP version installed, I'm not sure >>> how OTP 19 or 20 would behave. >>> >>> I tried to strace the processes, but there's too much noise, I couldn't >>> yet figure out anything interesting there. >>> >>> I also tried to diff OTP 17 & 18, but os:cmd/1 and friends didn't >>> change. I'm not sure about the port code, but at least the release notes >>> didn't mention anything major. Or did I miss something? Does anyone have an >>> idea what may have changed between these OTP versions? >>> >>> Thanks, >>> Daniel >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From albin.stigo@REDACTED Thu Jul 27 02:45:57 2017 From: albin.stigo@REDACTED (=?UTF-8?B?QWxiaW4gU3RpZ8O2?=) Date: Thu, 27 Jul 2017 02:45:57 +0200 Subject: [erlang-questions] My quest for a decent way to make a GUI in erlang In-Reply-To: References: Message-ID: I think NeXT and OpenStep used display postscript? Cocoa evolved from NeXT but they moved away from display postscript for performance reasons. A lot has happened since then so maybe the time has come for display postscript? > ...a minimal system with only > the good parts (which in my mind is *just* a drawing surface, can a canvas > or SVG responsive widget) a small scripting language (say Lua or JS) and > a communication method (say JSON) and transport mechanism (say TCP) Sounds a bit like X11. But X11 isn't exactly minimal of course. Interestingly there's a shift away from this model with Mir and Wayland. From my understanding this is to make better use of modern graphics hardware; shaders etc. A canvas model is really great for graphics experiments. If someone could port something like Processing.org to Erlang, that would be really neat. But for applications I do like a native look and feel. --Albin On Wed, Jul 26, 2017 at 10:57 PM, Joe Armstrong wrote: > One other point that I omitted to make > > When I wrote ex11 (a graphics experiment) I realised that > 3D objects with behaviour are *really* just 2-D objects + time. > > A button is just a rectangle with a shadow draw round it. When you > click it it moves down and the shadow changes, a little while later it returns > to its original position. > > I wanted to make a tabbed widget - now you might think that I could > combine buttons in some kind of hbox - well yes you can but it looks > terrible. No a tabbed widget viewed as a 2D drawing is "just" a line > that moves up and down and a few shadows in the appropriate places. > > So the way to make a tabbed widget is *not* to compose a hbox of buttons > but to draw the outline of what you want in 2D and make some regions that > are sensitive to mouse clicks. > > The abstractions you think you need (buttons, sliders) are not the ones that > are useful from a compositional point of view. > > This is actually why I like SVG - there are two abstractions path and group > - path draws a curve. Group glues objects and has an optional affine > transformation. All other SVG objects (rectangles, circles, lines, > ...) can > be constructed from paths and groups. > > Postscript is another *great* and not very well understood language - > display postscript would be great for GUIs but which is sadly not used. > > It's crazy - in the browser it's really easy to mock up an interface > with SVG or a canvas or by adding things to the DOM - but on the > desktop it's a pain in the whatnot. > > The answer is *not* to bundle the entire browser into a stand alone app > but to strip out the good parts and make a minimal system with only > the good parts (which in my mind is *just* a drawing surface, can a canvas > or SVG responsive widget) a small scripting language (say Lua or JS) and > a communication method (say JSON) and transport mechanism (say TCP) > > This (of course) is what we do not do :-) - instead everything that has ever > seen the light of day is bundled into the browser and the parts cannot be > easily separated. > > Cheers > > /Joe > > > On Wed, Jul 26, 2017 at 10:20 PM, Albin Stig? wrote: >> Hi Joe, >> >> Nice research! Interesting list of software. >> >> I've used a lot of GUI libraries. My favorite is Cocoa/Xcode and QT is >> pretty good too. >> >> I like interface builders because you get instant visual feedback. >> Also IMHO the tricky part is not the initial layout of widgets but how >> to handle resizing. Interface builder in Xcode solves this with >> constraints. They have a learning curve but it works pretty well. For >> serious work you also have to consider i18n. >> >> Cocoa is good because you can build interfaces both programmatically >> and with interface builder, and you can combine the two approaches. >> Interface builder just serializes the object graph so they are >> essentially the same. >> >> I'd also say that a binding mechanism is essential to avoiding a lot >> of boilerplate code to keep the GUI updated. Cocoa has bindings (on >> osx) that's based on key value observing on (ios and osx). QT has >> signals and slots. >> >> >> --Albin >> >> >> On Wed, Jul 26, 2017 at 7:45 PM, Joe Armstrong wrote: >>> More on my search for a good (understandable) GUI engine... >>> >>> I've spent the last few weeks botanising through various >>> GUI/graphics construction kits - and goodness what a mess. >>> >>> I thought I'd share some of my experiences and see if >>> it resonates with anybody. >>> >>> 1) Gui building is an (almost) total mess - I say almost because >>> there is some good software around - but the good stuff tends to be >>> experimental, undocumented and difficult to use. >>> >>> 2) The most popular frameworks are bloated, difficult to use and >>> impossible to understand without significant effort. >>> >>> 3) wxWidgets and the Erlang port wxErlang is usable - but the >>> documentation assumes you are familiar with the wxWidgets way >>> of doing things and with OO callback programming - which is >>> *very* Un-Erlang way of thinking >>> >>> 4) The use of interface builders (Xcode, etc.) is a symptom of >>> problem. GUI codes gets so messy that it is virtually impossible >>> to write "by hand" - so enter the GUI builder - this is basically >>> giving up on the idea that GUIs can be written in a clear and >>> simple manner by hand. >>> >>> 5) In the late 1970 - mid 80's there were several GUI languages >>> and systems that were easy to use and easy to program. For >>> example Smalltalk, TCL, Visual basic, Borland Turbo Graphics >>> >>> Is there any good stuff around today? >>> >>> Surprisingly the answer is yes - but the code is difficult to find >>> not supported and not mainstream. >>> >>> First a couple of papers that you might find interesting: >>> >>> + http://www.eugenkiss.com/projects/thesis.pdf >>> and https://github.com/eugenkiss/7guis/wiki >>> >>> The author solves 7 different problems with a number of different >>> GUI's >>> >>> + http://blog.johnnovak.net/2016/05/29/cross-platform-gui-trainwreck-2016-edition/ >>> >>> A great read - This blog has a lot of good information about the techniques >>> used to build several state of the art GUIs (for example Reaper, >>> Blender, Light table) >>> so If you've every wondered how fancy GUIs work this article gives >>> several clues. >>> >>> It also has the rather nice example of a GUI written using the >>> Electron Framework >>> that made an 189 MB executable to bang up a window with a small number of >>> controls in it. >>> >>> There's a list of references in one of the comments to this blog that >>> lead to several interesting *small'ish GUIs' >>> >>> Good stuff >>> >>> I did find some good software and some potentially very good software. >>> My top picks are as follows: >>> >>> http://inscore.sourceforge.net/ >>> >>> This is my favorite from an architectural POV. >>> It is controlled entirely by sending it messages. >>> Not a single callback to be seen >>> >>> https://github.com/andlabs/libui >>> >>> This looks very promising - it's a cross platform adaption layer >>> with a C interface - I've only build it on a Mac but >>> the adaption layer looks pretty easy to use. There's a C interface >>> that could be adapted to Erlang. >>> >>> There are very few examples >>> https://github.com/andlabs/ui/wiki/Getting-Started >>> has a go example - but if you download and build the system the >>> C examples are easy to follow. >>> >>> http://www.red-lang.org/ >>> >>> Is amazing - Red is a language inspired by REBOL. >>> >>> REBOL never achieved much popularity - perhaps Red will. >>> Once you've see red you'll wonder why you program in anything else >>> (there are good reasons - but for simply desktop apps Red is great). >>> >>> https://github.com/wjakob/nanogui >>> >>> Restores my faith in programming - it's small and built on top >>> of https://github.com/memononen/NanoVG >>> >>> NanoVG is basically a canvas type interface to OpenGL >>> >>> Reading the NanoGui code made me wonder if the best way to make >>> a GUI for erlang would be to use OpenGL for the low-level stuff >>> and do all the rest in Erlang. >>> >>> Buttons etc. are pretty easy to define as processes which I believe >>> is the way http://www.wings3d.com/ did things. >>> >>> The future >>> >>> I'm still undecided - one of more of the following seem attractive >>> >>> 1) wxErlang - it works *but* it's big and ugly and has a nasty >>> programming model >>> 2) An interface to Red would be great - but red is pretty unknown >>> 3) libui looks promising - anybody interested in this? >>> 4) the nanogui/NanoVG track looks good - anything with nano in the >>> name has my vote >>> 5) The inscore architecture rules - NO CALLBACKS - Yea >>> >>> Verily verily I say unto you - "useth not the callback, even though >>> they that useth the callback are ignited with a great passion and >>> extol the virtues of the callback - for therein lies the madness >>> that do come when the callback faileth for reasons not comprehended' >>> >>> Thus it is writ. >>> >>> Cheers >>> >>> /Joe >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions From unix1@REDACTED Thu Jul 27 04:03:07 2017 From: unix1@REDACTED (Unix One) Date: Thu, 27 Jul 2017 02:03:07 +0000 Subject: [erlang-questions] My quest for a decent way to make a GUI in erlang In-Reply-To: References: Message-ID: On 07/26/2017 01:20 PM, Albin Stig? wrote: > QT has signals and slots. > I haven't done big projects in Qt, but little fiddling I did with a small GUI app, I found Qt+QML a pleasure to work with. Searching for Erlang-related examples, it just took about 30 secs to try this on my laptop: https://github.com/krant/eqml It's showing passing Erlang messages as signals to Qt slots and vice versa. If I were doing GUIs with Erlang, this would be one place I'd look closer. From ok@REDACTED Thu Jul 27 04:53:17 2017 From: ok@REDACTED (Richard A. O'Keefe) Date: Thu, 27 Jul 2017 14:53:17 +1200 Subject: [erlang-questions] My quest for a decent way to make a GUI in erlang In-Reply-To: References: Message-ID: <9dbb9326-c196-28f3-3340-fe757ab8d0ef@cs.otago.ac.nz> On 27/07/17 12:45 PM, Albin Stig? wrote: > I think NeXT and OpenStep used display postscript? Cocoa evolved from > NeXT but they moved away from display postscript for performance > reasons. A lot has happened since then so maybe the time has come for > display postscript? Before Display Postscript (developed for Apple) there was NeWS. See the NeWS book at http://bitsavers.trailing-edge.com/pdf/sun/NeWS/The_NeWS_Book_1989.pdf Programming in a concurrent OO extension of Postscript never really appealed to me, and the performance issues of thread decades ago probably look quite different today with GPUs. From dszoboszlay@REDACTED Thu Jul 27 09:21:20 2017 From: dszoboszlay@REDACTED (=?UTF-8?Q?D=C3=A1niel_Szoboszlay?=) Date: Thu, 27 Jul 2017 07:21:20 +0000 Subject: [erlang-questions] os:cmd hang on OTP 18 In-Reply-To: References: Message-ID: Thanks Dmytro, this really helped a lot! I think the commit you pointed to is not directly related: it only changes Erlang code, and if the behaviour depends on whether you are using a release/debug build, the root cause is most probably somewhere in the C code of erts. But the commit message talks about the emulator no longer using vfork, and it was a good clue: disabling vfork on 18 prevents the problem. So this one will finish: ERL_NO_VFORK=true erl +A0 +S 1:1 -noinput -noshell -eval 'os:cmd("tar -C /tmp/ -xf /tmp/tartest --use-compress-program=lbzip2"), init:stop().' Thanks again for the clue, I will look into the difference between using fork/vfork in OTP 18! Daniel On Thu, 27 Jul 2017 at 02:09 Dmytro Lytovchenko < dmytro.lytovchenko@REDACTED> wrote: > I could observe the behaviour only in R18, but not in R19 and not in R20 > I also could not reproduce it in debug flavour of R18 emulator, but it > reproduces reliably in release SMP variant. > > The changes to os.erl between 18.3.4.5 and 19.0 include removal of os:cmd > server which might somehow be related (commit > *200247f972b012ced0c4b2c6611f091af66ebedd*). This commit *possibly* fixes > the behavior ? in R19 (build 19.0 by Kerl) the behaviour does not happen. > > 2017-07-26 21:47 GMT+02:00 D?niel Szoboszlay : > >> Honestly, I didn't try with other command variations. There are many >> commands that do not hang when run from os:cmd, regardless of the OTP >> version. But this particular command does hang with one OTP version, and >> not with the other OTP version. So the difference is in OTP, and I want to >> find out what has changed. >> >> Daniel >> >> On Wed, 26 Jul 2017 at 21:34 Dmytro Lytovchenko < >> dmytro.lytovchenko@REDACTED> wrote: >> >>> Is it something lbzip2 related? >>> Did you try normal single-thread bzip2? (-j flag or --bzip2) >>> What is you use gzip? (-z or --gzip) >>> >>> 2017-07-26 21:27 GMT+02:00 D?niel Szoboszlay : >>> >>>> Hi, >>>> >>>> I've encountered a strange problem with os:cmd when running tar and >>>> lbzip2. Steps to reproduce: >>>> >>>> # create some lbzip2 compressed data >>>> >>>> dd if=/dev/urandom of=/tmp/testfile count=10 >>>> tar -cf - -C /tmp testfile | lbzip2 -6 -n 4 | dd of=/tmp/tartest status=none >>>> >>>> >>>> # try to extract the archive from Erlang with os:cmd >>>> >>>> erl -noinput -eval 'os:cmd("tar -C /tmp/ -xf /tmp/tartest --use-compress-program=lbzip2"), init:stop().' >>>> >>>> >>>> This worked fine with OTP 17.5.6.7, but with OTP 18.3.4.5 the command >>>> hangs: lbzip2 just sits in a rt_sigsuspend syscall waiting for a USR2, PIPE >>>> or XFSZ signal. And its parent, the tar process waits in a wait4 syscall >>>> for lbzip2 to terminate. >>>> >>>> I don't have at the moment any newer OTP version installed, I'm not >>>> sure how OTP 19 or 20 would behave. >>>> >>>> I tried to strace the processes, but there's too much noise, I couldn't >>>> yet figure out anything interesting there. >>>> >>>> I also tried to diff OTP 17 & 18, but os:cmd/1 and friends didn't >>>> change. I'm not sure about the port code, but at least the release notes >>>> didn't mention anything major. Or did I miss something? Does anyone have an >>>> idea what may have changed between these OTP versions? >>>> >>>> Thanks, >>>> Daniel >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.hogberg@REDACTED Thu Jul 27 09:30:05 2017 From: john.hogberg@REDACTED (=?iso-8859-1?Q?John_H=F6gberg?=) Date: Thu, 27 Jul 2017 07:30:05 +0000 Subject: [erlang-questions] Patch Package OTP 20.0.2 Released Message-ID: Patch Package: OTP 20.0.2 Git Tag: OTP-20.0.2 Date: 2017-07-27 Trouble Report Id: OTP-14494, OTP-14498, OTP-14509, OTP-14514, OTP-14519 Seq num: ERIERL-49 System: OTP Release: 20 Application: asn1-5.0.1, erts-9.0.2, kernel-5.3.1 Predecessor: OTP 20.0.1 Check out the git tag OTP-20.0.2, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- asn1-5.0.1 ------------------------------------------------------ --------------------------------------------------------------------- The asn1-5.0.1 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-14519 Application(s): asn1 Related Id(s): ERIERL-49 Fixed compilation error of generated code caused by a missing quotation of function names as part of an external call for encoding. Full runtime dependencies of asn1-5.0.1: erts-7.0, kernel-3.0, stdlib-2.0 --------------------------------------------------------------------- --- erts-9.0.2 ------------------------------------------------------ --------------------------------------------------------------------- The erts-9.0.2 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-14494 Application(s): erts Added missing release notes for OTP-14491 ("performance bug in pre-allocators") which was included in erts-9.0.1 (OTP-20.0.1). OTP-14509 Application(s): erts Fixed a bug that prevented TCP sockets from being closed properly on send timeouts. OTP-14514 Application(s): erts Fixed bug in operator bxor causing erroneuos result when one operand is a big *negative* integer with the lowest N*W bits as zero and the other operand not larger than N*W bits. N is an integer of 1 or larger and W is 32 or 64 depending on word size. Full runtime dependencies of erts-9.0.2: kernel-5.0, sasl-3.0.1, stdlib-3.0 --------------------------------------------------------------------- --- kernel-5.3.1 ---------------------------------------------------- --------------------------------------------------------------------- The kernel-5.3.1 application can be applied independently of other applications on a full OTP 20 installation. --- Fixed Bugs and Malfunctions --- OTP-14498 Application(s): kernel The documentation for the 'quiet' option in disk_log:open/1 had an incorrect default value. Full runtime dependencies of kernel-5.3.1: erts-9.0, sasl-3.0, stdlib-3.0 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From varjaofilipe@REDACTED Thu Jul 27 14:08:02 2017 From: varjaofilipe@REDACTED (=?UTF-8?Q?Filipe_Varj=C3=A3o?=) Date: Thu, 27 Jul 2017 09:08:02 -0300 Subject: [erlang-questions] My quest for a decent way to make a GUI in erlang (Filipe) Message-ID: I have some experience with Qt Creator, building the GUI first and make the connection between the buttons and back-end, with separate steps like web applications. I strongly recommend. On Thu, Jul 27, 2017 at 7:00 AM, wrote: > Send erlang-questions mailing list submissions to > erlang-questions@REDACTED > > To subscribe or unsubscribe via the World Wide Web, visit > http://erlang.org/mailman/listinfo/erlang-questions > or, via email, send a message with subject or body 'help' to > erlang-questions-request@REDACTED > > You can reach the person managing the list at > erlang-questions-owner@REDACTED > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of erlang-questions digest..." > > > Today's Topics: > > 1. Re: My quest for a decent way to make a GUI in erlang > (Albin Stig?) > 2. Re: My quest for a decent way to make a GUI in erlang (Unix One) > 3. Re: My quest for a decent way to make a GUI in erlang > (Richard A. O'Keefe) > 4. Re: os:cmd hang on OTP 18 (D?niel Szoboszlay) > 5. Patch Package OTP 20.0.2 Released (John H?gberg) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 27 Jul 2017 02:45:57 +0200 > From: Albin Stig? > To: Joe Armstrong > Cc: Erlang > Subject: Re: [erlang-questions] My quest for a decent way to make a > GUI in erlang > Message-ID: > TbK1hhBSGi61atA@REDACTED> > Content-Type: text/plain; charset="UTF-8" > > I think NeXT and OpenStep used display postscript? Cocoa evolved from > NeXT but they moved away from display postscript for performance > reasons. A lot has happened since then so maybe the time has come for > display postscript? > > > ...a minimal system with only > > the good parts (which in my mind is *just* a drawing surface, can a > canvas > > or SVG responsive widget) a small scripting language (say Lua or JS) and > > a communication method (say JSON) and transport mechanism (say TCP) > > Sounds a bit like X11. But X11 isn't exactly minimal of course. > Interestingly there's a shift away from this model with Mir and > Wayland. From my understanding this is to make better use of modern > graphics hardware; shaders etc. > > A canvas model is really great for graphics experiments. If someone > could port something like Processing.org to Erlang, that would be > really neat. But for applications I do like a native look and feel. > > > --Albin > > On Wed, Jul 26, 2017 at 10:57 PM, Joe Armstrong wrote: > > One other point that I omitted to make > > > > When I wrote ex11 (a graphics experiment) I realised that > > 3D objects with behaviour are *really* just 2-D objects + time. > > > > A button is just a rectangle with a shadow draw round it. When you > > click it it moves down and the shadow changes, a little while later it > returns > > to its original position. > > > > I wanted to make a tabbed widget - now you might think that I could > > combine buttons in some kind of hbox - well yes you can but it looks > > terrible. No a tabbed widget viewed as a 2D drawing is "just" a line > > that moves up and down and a few shadows in the appropriate places. > > > > So the way to make a tabbed widget is *not* to compose a hbox of buttons > > but to draw the outline of what you want in 2D and make some regions that > > are sensitive to mouse clicks. > > > > The abstractions you think you need (buttons, sliders) are not the ones > that > > are useful from a compositional point of view. > > > > This is actually why I like SVG - there are two abstractions path and > group > > - path draws a curve. Group glues objects and has an optional affine > > transformation. All other SVG objects (rectangles, circles, lines, > > ...) can > > be constructed from paths and groups. > > > > Postscript is another *great* and not very well understood language - > > display postscript would be great for GUIs but which is sadly not used. > > > > It's crazy - in the browser it's really easy to mock up an interface > > with SVG or a canvas or by adding things to the DOM - but on the > > desktop it's a pain in the whatnot. > > > > The answer is *not* to bundle the entire browser into a stand alone app > > but to strip out the good parts and make a minimal system with only > > the good parts (which in my mind is *just* a drawing surface, can a > canvas > > or SVG responsive widget) a small scripting language (say Lua or JS) and > > a communication method (say JSON) and transport mechanism (say TCP) > > > > This (of course) is what we do not do :-) - instead everything that has > ever > > seen the light of day is bundled into the browser and the parts cannot be > > easily separated. > > > > Cheers > > > > /Joe > > > > > > On Wed, Jul 26, 2017 at 10:20 PM, Albin Stig? > wrote: > >> Hi Joe, > >> > >> Nice research! Interesting list of software. > >> > >> I've used a lot of GUI libraries. My favorite is Cocoa/Xcode and QT is > >> pretty good too. > >> > >> I like interface builders because you get instant visual feedback. > >> Also IMHO the tricky part is not the initial layout of widgets but how > >> to handle resizing. Interface builder in Xcode solves this with > >> constraints. They have a learning curve but it works pretty well. For > >> serious work you also have to consider i18n. > >> > >> Cocoa is good because you can build interfaces both programmatically > >> and with interface builder, and you can combine the two approaches. > >> Interface builder just serializes the object graph so they are > >> essentially the same. > >> > >> I'd also say that a binding mechanism is essential to avoiding a lot > >> of boilerplate code to keep the GUI updated. Cocoa has bindings (on > >> osx) that's based on key value observing on (ios and osx). QT has > >> signals and slots. > >> > >> > >> --Albin > >> > >> > >> On Wed, Jul 26, 2017 at 7:45 PM, Joe Armstrong > wrote: > >>> More on my search for a good (understandable) GUI engine... > >>> > >>> I've spent the last few weeks botanising through various > >>> GUI/graphics construction kits - and goodness what a mess. > >>> > >>> I thought I'd share some of my experiences and see if > >>> it resonates with anybody. > >>> > >>> 1) Gui building is an (almost) total mess - I say almost because > >>> there is some good software around - but the good stuff tends to be > >>> experimental, undocumented and difficult to use. > >>> > >>> 2) The most popular frameworks are bloated, difficult to use and > >>> impossible to understand without significant effort. > >>> > >>> 3) wxWidgets and the Erlang port wxErlang is usable - but the > >>> documentation assumes you are familiar with the wxWidgets way > >>> of doing things and with OO callback programming - which is > >>> *very* Un-Erlang way of thinking > >>> > >>> 4) The use of interface builders (Xcode, etc.) is a symptom of > >>> problem. GUI codes gets so messy that it is virtually impossible > >>> to write "by hand" - so enter the GUI builder - this is basically > >>> giving up on the idea that GUIs can be written in a clear and > >>> simple manner by hand. > >>> > >>> 5) In the late 1970 - mid 80's there were several GUI languages > >>> and systems that were easy to use and easy to program. For > >>> example Smalltalk, TCL, Visual basic, Borland Turbo Graphics > >>> > >>> Is there any good stuff around today? > >>> > >>> Surprisingly the answer is yes - but the code is difficult to find > >>> not supported and not mainstream. > >>> > >>> First a couple of papers that you might find interesting: > >>> > >>> + http://www.eugenkiss.com/projects/thesis.pdf > >>> and https://github.com/eugenkiss/7guis/wiki > >>> > >>> The author solves 7 different problems with a number of different > >>> GUI's > >>> > >>> + http://blog.johnnovak.net/2016/05/29/cross-platform-gui- > trainwreck-2016-edition/ > >>> > >>> A great read - This blog has a lot of good information about the > techniques > >>> used to build several state of the art GUIs (for example Reaper, > >>> Blender, Light table) > >>> so If you've every wondered how fancy GUIs work this article gives > >>> several clues. > >>> > >>> It also has the rather nice example of a GUI written using the > >>> Electron Framework > >>> that made an 189 MB executable to bang up a window with a small > number of > >>> controls in it. > >>> > >>> There's a list of references in one of the comments to this blog > that > >>> lead to several interesting *small'ish GUIs' > >>> > >>> Good stuff > >>> > >>> I did find some good software and some potentially very good > software. > >>> My top picks are as follows: > >>> > >>> http://inscore.sourceforge.net/ > >>> > >>> This is my favorite from an architectural POV. > >>> It is controlled entirely by sending it messages. > >>> Not a single callback to be seen > >>> > >>> https://github.com/andlabs/libui > >>> > >>> This looks very promising - it's a cross platform adaption layer > >>> with a C interface - I've only build it on a Mac but > >>> the adaption layer looks pretty easy to use. There's a C > interface > >>> that could be adapted to Erlang. > >>> > >>> There are very few examples > >>> https://github.com/andlabs/ui/wiki/Getting-Started > >>> has a go example - but if you download and build the system the > >>> C examples are easy to follow. > >>> > >>> http://www.red-lang.org/ > >>> > >>> Is amazing - Red is a language inspired by REBOL. > >>> > >>> REBOL never achieved much popularity - perhaps Red will. > >>> Once you've see red you'll wonder why you program in anything > else > >>> (there are good reasons - but for simply desktop apps Red is > great). > >>> > >>> https://github.com/wjakob/nanogui > >>> > >>> Restores my faith in programming - it's small and built on top > >>> of https://github.com/memononen/NanoVG > >>> > >>> NanoVG is basically a canvas type interface to OpenGL > >>> > >>> Reading the NanoGui code made me wonder if the best way to make > >>> a GUI for erlang would be to use OpenGL for the low-level stuff > >>> and do all the rest in Erlang. > >>> > >>> Buttons etc. are pretty easy to define as processes which I > believe > >>> is the way http://www.wings3d.com/ did things. > >>> > >>> The future > >>> > >>> I'm still undecided - one of more of the following seem attractive > >>> > >>> 1) wxErlang - it works *but* it's big and ugly and has a nasty > >>> programming model > >>> 2) An interface to Red would be great - but red is pretty unknown > >>> 3) libui looks promising - anybody interested in this? > >>> 4) the nanogui/NanoVG track looks good - anything with nano in the > >>> name has my vote > >>> 5) The inscore architecture rules - NO CALLBACKS - Yea > >>> > >>> Verily verily I say unto you - "useth not the callback, even though > >>> they that useth the callback are ignited with a great passion and > >>> extol the virtues of the callback - for therein lies the madness > >>> that do come when the callback faileth for reasons not comprehended' > >>> > >>> Thus it is writ. > >>> > >>> Cheers > >>> > >>> /Joe > >>> _______________________________________________ > >>> erlang-questions mailing list > >>> erlang-questions@REDACTED > >>> http://erlang.org/mailman/listinfo/erlang-questions > > > ------------------------------ > > Message: 2 > Date: Thu, 27 Jul 2017 02:03:07 +0000 > From: Unix One > To: Albin Stig? , Joe Armstrong > > Cc: Erlang > Subject: Re: [erlang-questions] My quest for a decent way to make a > GUI in erlang > Message-ID: > namprd19.prod.outlook.com> > > Content-Type: text/plain; charset="utf-8" > > On 07/26/2017 01:20 PM, Albin Stig? wrote: > > > QT has signals and slots. > > > > I haven't done big projects in Qt, but little fiddling I did with a > small GUI app, I found Qt+QML a pleasure to work with. > > Searching for Erlang-related examples, it just took about 30 secs to try > this on my laptop: > > https://github.com/krant/eqml > > It's showing passing Erlang messages as signals to Qt slots and vice > versa. If I were doing GUIs with Erlang, this would be one place I'd > look closer. > > ------------------------------ > > Message: 3 > Date: Thu, 27 Jul 2017 14:53:17 +1200 > From: "Richard A. O'Keefe" > To: > Subject: Re: [erlang-questions] My quest for a decent way to make a > GUI in erlang > Message-ID: <9dbb9326-c196-28f3-3340-fe757ab8d0ef@REDACTED> > Content-Type: text/plain; charset="utf-8"; format=flowed > > > > On 27/07/17 12:45 PM, Albin Stig? wrote: > > I think NeXT and OpenStep used display postscript? Cocoa evolved from > > NeXT but they moved away from display postscript for performance > > reasons. A lot has happened since then so maybe the time has come for > > display postscript? > > Before Display Postscript (developed for Apple) > there was NeWS. See the NeWS book at > http://bitsavers.trailing-edge.com/pdf/sun/NeWS/The_NeWS_Book_1989.pdf > > Programming in a concurrent OO extension of Postscript never really > appealed to me, and the performance issues of thread decades ago > probably look quite different today with GPUs. > > > > ------------------------------ > > Message: 4 > Date: Thu, 27 Jul 2017 07:21:20 +0000 > From: D?niel Szoboszlay > To: Dmytro Lytovchenko > Cc: erlang-questions > Subject: Re: [erlang-questions] os:cmd hang on OTP 18 > Message-ID: > gmail.com> > Content-Type: text/plain; charset="utf-8" > > Thanks Dmytro, this really helped a lot! > > I think the commit you pointed to is not directly related: it only changes > Erlang code, and if the behaviour depends on whether you are using a > release/debug build, the root cause is most probably somewhere in the C > code of erts. > > But the commit message talks about the emulator no longer using vfork, and > it was a good clue: disabling vfork on 18 prevents the problem. So this one > will finish: > > ERL_NO_VFORK=true erl +A0 +S 1:1 -noinput -noshell -eval 'os:cmd("tar -C > /tmp/ -xf /tmp/tartest --use-compress-program=lbzip2"), init:stop().' > > Thanks again for the clue, I will look into the difference between using > fork/vfork in OTP 18! > > Daniel > > On Thu, 27 Jul 2017 at 02:09 Dmytro Lytovchenko < > dmytro.lytovchenko@REDACTED> wrote: > > > I could observe the behaviour only in R18, but not in R19 and not in R20 > > I also could not reproduce it in debug flavour of R18 emulator, but it > > reproduces reliably in release SMP variant. > > > > The changes to os.erl between 18.3.4.5 and 19.0 include removal of os:cmd > > server which might somehow be related (commit > > *200247f972b012ced0c4b2c6611f091af66ebedd*). This commit *possibly* > fixes > > the behavior ? in R19 (build 19.0 by Kerl) the behaviour does not happen. > > > > 2017-07-26 21:47 GMT+02:00 D?niel Szoboszlay : > > > >> Honestly, I didn't try with other command variations. There are many > >> commands that do not hang when run from os:cmd, regardless of the OTP > >> version. But this particular command does hang with one OTP version, and > >> not with the other OTP version. So the difference is in OTP, and I want > to > >> find out what has changed. > >> > >> Daniel > >> > >> On Wed, 26 Jul 2017 at 21:34 Dmytro Lytovchenko < > >> dmytro.lytovchenko@REDACTED> wrote: > >> > >>> Is it something lbzip2 related? > >>> Did you try normal single-thread bzip2? (-j flag or --bzip2) > >>> What is you use gzip? (-z or --gzip) > >>> > >>> 2017-07-26 21:27 GMT+02:00 D?niel Szoboszlay : > >>> > >>>> Hi, > >>>> > >>>> I've encountered a strange problem with os:cmd when running tar and > >>>> lbzip2. Steps to reproduce: > >>>> > >>>> # create some lbzip2 compressed data > >>>> > >>>> dd if=/dev/urandom of=/tmp/testfile count=10 > >>>> tar -cf - -C /tmp testfile | lbzip2 -6 -n 4 | dd of=/tmp/tartest > status=none > >>>> > >>>> > >>>> # try to extract the archive from Erlang with os:cmd > >>>> > >>>> erl -noinput -eval 'os:cmd("tar -C /tmp/ -xf /tmp/tartest > --use-compress-program=lbzip2"), init:stop().' > >>>> > >>>> > >>>> This worked fine with OTP 17.5.6.7, but with OTP 18.3.4.5 the command > >>>> hangs: lbzip2 just sits in a rt_sigsuspend syscall waiting for a > USR2, PIPE > >>>> or XFSZ signal. And its parent, the tar process waits in a wait4 > syscall > >>>> for lbzip2 to terminate. > >>>> > >>>> I don't have at the moment any newer OTP version installed, I'm not > >>>> sure how OTP 19 or 20 would behave. > >>>> > >>>> I tried to strace the processes, but there's too much noise, I > couldn't > >>>> yet figure out anything interesting there. > >>>> > >>>> I also tried to diff OTP 17 & 18, but os:cmd/1 and friends didn't > >>>> change. I'm not sure about the port code, but at least the release > notes > >>>> didn't mention anything major. Or did I miss something? Does anyone > have an > >>>> idea what may have changed between these OTP versions? > >>>> > >>>> Thanks, > >>>> Daniel > >>>> > >>>> _______________________________________________ > >>>> erlang-questions mailing list > >>>> erlang-questions@REDACTED > >>>> http://erlang.org/mailman/listinfo/erlang-questions > >>>> > >>>> > >>> > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: 20170727/2c790fa8/attachment-0001.html> > > ------------------------------ > > Message: 5 > Date: Thu, 27 Jul 2017 07:30:05 +0000 > From: John H?gberg > To: "erlang-questions@REDACTED" > Subject: [erlang-questions] Patch Package OTP 20.0.2 Released > Message-ID: > eurprd07.prod.outlook.com> > > Content-Type: text/plain; charset="iso-8859-1" > > Patch Package: OTP 20.0.2 > Git Tag: OTP-20.0.2 > Date: 2017-07-27 > Trouble Report Id: OTP-14494, OTP-14498, OTP-14509, OTP-14514, > OTP-14519 > Seq num: ERIERL-49 > System: OTP > Release: 20 > Application: asn1-5.0.1, erts-9.0.2, kernel-5.3.1 > Predecessor: OTP 20.0.1 > > Check out the git tag OTP-20.0.2, and build a full OTP system > including documentation. Apply one or more applications from this > build as patches to your installation using the 'otp_patch_apply' > tool. For information on install requirements, see descriptions for > each application version below. > > --------------------------------------------------------------------- > --- asn1-5.0.1 ------------------------------------------------------ > --------------------------------------------------------------------- > > The asn1-5.0.1 application can be applied independently of other > applications on a full OTP 20 installation. > > --- Fixed Bugs and Malfunctions --- > > OTP-14519 Application(s): asn1 > Related Id(s): ERIERL-49 > > Fixed compilation error of generated code caused by a > missing quotation of function names as part of an > external call for encoding. > > > Full runtime dependencies of asn1-5.0.1: erts-7.0, kernel-3.0, > stdlib-2.0 > > > --------------------------------------------------------------------- > --- erts-9.0.2 ------------------------------------------------------ > --------------------------------------------------------------------- > > The erts-9.0.2 application can be applied independently of other > applications on a full OTP 20 installation. > > --- Fixed Bugs and Malfunctions --- > > OTP-14494 Application(s): erts > > Added missing release notes for OTP-14491 ("performance > bug in pre-allocators") which was included in > erts-9.0.1 (OTP-20.0.1). > > > OTP-14509 Application(s): erts > > Fixed a bug that prevented TCP sockets from being > closed properly on send timeouts. > > > OTP-14514 Application(s): erts > > Fixed bug in operator bxor causing erroneuos result > when one operand is a big *negative* integer with the > lowest N*W bits as zero and the other operand not > larger than N*W bits. N is an integer of 1 or larger > and W is 32 or 64 depending on word size. > > > Full runtime dependencies of erts-9.0.2: kernel-5.0, sasl-3.0.1, > stdlib-3.0 > > > --------------------------------------------------------------------- > --- kernel-5.3.1 ---------------------------------------------------- > --------------------------------------------------------------------- > > The kernel-5.3.1 application can be applied independently of other > applications on a full OTP 20 installation. > > --- Fixed Bugs and Malfunctions --- > > OTP-14498 Application(s): kernel > > The documentation for the 'quiet' option in > disk_log:open/1 had an incorrect default value. > > > Full runtime dependencies of kernel-5.3.1: erts-9.0, sasl-3.0, > stdlib-3.0 > > > --------------------------------------------------------------------- > --------------------------------------------------------------------- > --------------------------------------------------------------------- > > > ------------------------------ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > End of erlang-questions Digest, Vol 332, Issue 5 > ************************************************ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Catenacci@REDACTED Thu Jul 27 14:29:13 2017 From: Catenacci@REDACTED (Onorio Catenacci) Date: Thu, 27 Jul 2017 08:29:13 -0400 Subject: [erlang-questions] My quest for a decent way to make a GUI in Erlang Message-ID: First of all, thanks Joe for feeding my magpie developer syndrome with more cool new stuff to look at! Secondly, I'm glad to see that I'm not the only one who remembers the idea of building a GUI for a desktop app. The default answer for most all developers seems to be slap together a webapp--which is fine for a lot of situations but there are definite advantages to a genuine GUI on a desktop app. Sadly it seems to be the case that a lot of developers are opting to learn JavaScript and all the hacks needed to make that a viable platform than learning better ways of doing things. That seems to follow from the "everything must be a webapp" school of thinking. -- Onorio Catenacci http://onor.io http://www.google.com/+OnorioCatenacci -------------- next part -------------- An HTML attachment was scrubbed... URL: From codewiget95@REDACTED Thu Jul 27 15:01:21 2017 From: codewiget95@REDACTED (code wiget) Date: Thu, 27 Jul 2017 09:01:21 -0400 Subject: [erlang-questions] Node not active but is connected In-Reply-To: <8A4DB46B-ACF7-4D7B-AFE6-B462C727B3E2@gmail.com> References: <8A4DB46B-ACF7-4D7B-AFE6-B462C727B3E2@gmail.com> Message-ID: <8CC5E67D-D10E-498E-96DA-83532C3564EE@gmail.com> I would like to refine my question a bit. The real problem that I am having is how to share an mnesia db between two nodes that already have their own databases: I have 3 erlang nodes, 2 are emqtt brokers and 1 is a special node for setting up a key value store. The 2 emqtt brokers have instances of mnesia running that are disc copies, and they need to be able to get a copy of a table from the mnesia database running on the special node. I have read through all of the questions on stack pertaining to this but have yet to find a way to share a database across nodes from one central node. I have tried copying tables to my emqtt instances using add_table_copy(device, 'emqttd@REDACTED', ram_copies), but I get the error that my device table already exists, when it does not: Special Node: ------------------------------------------------------------------------------------------------------------------------------------------------------------ (ryan@REDACTED)35> mnesia:add_table_copy(device, 'emqttd@REDACTED', ram_copies). {aborted ,{already_exists,device,'emqttd@REDACTED'}} Emqtt: (emqttd@REDACTED)2> mnesia:info(). ------------------------------------------------------------------------------------------------------------------------------------------------------------ ---> Processes holding locks <--- ---> Processes waiting for locks <--- ---> Participant transactions <--- ---> Coordinator transactions <--- ---> Uncertain transactions <--- ---> Active tables <--- mqtt_admin : with 1 records occupying 326 words of mem mqtt_retained : with 3 records occupying 194 words of mem mqtt_route : with 0 records occupying 304 words of mem mqtt_topic : with 0 records occupying 304 words of mem mqtt_session : with 0 records occupying 304 words of mem mqtt_trie_node : with 0 records occupying 304 words of mem mqtt_trie : with 0 records occupying 304 words of mem schema : with 8 records occupying 1273 words of mem ===> System info in version "4.14.2", debug level = none <=== opt_disc . Directory "/Users/ryanauger/repos/emq-relx/_rel/emqttd/data/mnesia/emqttd@REDACTED" is used. use fallback at restart = false running db nodes = [ 'emqttd@REDACTED' ] stopped db nodes = [] master node tables = [] remote = [] ram_copies = [mqtt_retained ,mqtt_route,mqtt_session,mqtt_topic, mqtt_trie , mqtt_trie_node] disc_copies = [mqtt_admin , schema] disc_only_copies = [] [{ 'emqttd@REDACTED',disc_copies}] = [schema, mqtt_admin] [{ 'emqttd@REDACTED',ram_copies}] = [mqtt_trie,mqtt_trie_node,mqtt_session, mqtt_topic ,mqtt_route, mqtt_retained] 10 transactions committed, 2 aborted, 0 restarted, 15 logged to disc 0 held locks, 0 in queue; 0 local transactions, 0 remote 0 transactions waits for other nodes: [] ok --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- How would I go about sharing the tables from this database? Based on my research, it seems like it may not be possible with mnesia. If so, please suggest another tool that can integrate with erlang! > On Jul 26, 2017, at 3:37 PM, code wiget wrote: > > Hello, > > For background, right now I have two instances of emqtt running on two separate computers on the same network. I have written an Erlang program to create an mnesia instance and a shared table between them, as I need to be able to access an important key value store from both instances. > > The problem is that I can use net_kernel:connect_node(?emqttd@REDACTED?). to connect the nodes, which is successful, but then when I try to use amnesia:create table with disc copies on all of those nodes, I get an error that the nodes I am connecting to are not active. Below I will illustrate the flow: > > connect_all_nodes(Nodelist) > nodes() is now = Nodelist > mnesia:create_schema([node()]) ? create a scheme on the local, non-emqtt instance (cannot add other nodes as they have their own mnesia DB?s running) > Start mnesia > mnesia:Create_table(device, [{attributes, record_info(fields, device)}, > {disc_copies, nodes()}, > {type, set}]). > > ? this last command fails with the error:{aborted,{not_active,iot_device,?emqttd@REDACTED?}} > ?How is it possible that my node thinks this device is not active if I have already connected the nodes, verified that nodes() has been populated, and I?ve even tested using net_admn ping and I get a pong. > > How do I get them to truly recognize each other? > > > Thank you for your help! -------------- next part -------------- An HTML attachment was scrubbed... URL: From hawk.mattsson@REDACTED Thu Jul 27 16:19:17 2017 From: hawk.mattsson@REDACTED (=?UTF-8?Q?H=C3=A5kan_Mattsson?=) Date: Thu, 27 Jul 2017 16:19:17 +0200 Subject: [erlang-questions] Internal compiler atoms Message-ID: I am trying to compile a ?(? big ?)? module from a list of forms ?? , but it seems ? like the compiler internally generates lots of new atoms:? no more index entries in atom_tab (max=1048576) Crash dump is being written to: erl_crash.dump... ?In this case the compiler itself generated ?more than 300K atoms while compiling my forms. ? ?Why is the atoms generated?? ?Is this anything that can be disabled?? /H?kan -------------- next part -------------- An HTML attachment was scrubbed... URL: From silviu.cpp@REDACTED Thu Jul 27 16:49:28 2017 From: silviu.cpp@REDACTED (Caragea Silviu) Date: Thu, 27 Jul 2017 17:49:28 +0300 Subject: [erlang-questions] NIF how to check the vm version Message-ID: Hello, There is any define in the nif headers to indicate what OTP version I'm compiling against ? i want to change one of my projects in case it;s compiled against OTP 20 or newer to use enif_select for some features. Thanks, Silviu -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Thu Jul 27 17:06:00 2017 From: vinoski@REDACTED (Steve Vinoski) Date: Thu, 27 Jul 2017 11:06:00 -0400 Subject: [erlang-questions] NIF how to check the vm version In-Reply-To: References: Message-ID: On Thu, Jul 27, 2017 at 10:49 AM, Caragea Silviu wrote: > Hello, > > There is any define in the nif headers to indicate what OTP version I'm > compiling against ? > > i want to change one of my projects in case it;s compiled against OTP 20 > or newer to use enif_select for some features. > #define ERL_NIF_MAJOR_VERSION 2 #define ERL_NIF_MINOR_VERSION 12 You'll need to figure out the version at which your desired feature appeared. --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From codewiget95@REDACTED Fri Jul 28 00:09:05 2017 From: codewiget95@REDACTED (code wiget) Date: Thu, 27 Jul 2017 18:09:05 -0400 Subject: [erlang-questions] Accessing a gen_server function from another process Message-ID: <20036004-74A4-46B6-B8C1-379D6A3A402F@gmail.com> Hello, I am learning about gen_servers right now and I am confused on what I should do about calling a gen_server function that requires a pid. Generally, gen_server:start_link returns a tuple of the form {ok, Pid}, where Pid is used for API calls to the server. Now, Erlang doesn?t have any good way of storing state, such as a variable to hold this Pid. So, If I have a function that every once in a while needs to call this API, but that API needs a Pid, and theres no way to get a Pid without starting a whole new server? how is this done? I am sure the answer is not too complex, I greatly appreciate your replies as I am just learning Erlang(on ch 14 of Learn you some Erlang for Great Good). From martin@REDACTED Fri Jul 28 00:34:22 2017 From: martin@REDACTED (Martin Karlsson) Date: Fri, 28 Jul 2017 10:34:22 +1200 Subject: [erlang-questions] Accessing a gen_server function from another process In-Reply-To: <20036004-74A4-46B6-B8C1-379D6A3A402F@gmail.com> References: <20036004-74A4-46B6-B8C1-379D6A3A402F@gmail.com> Message-ID: <20170727223422.ahggpijhu73j75hm@littledevil.rpk> >Generally, gen_server:start_link returns a tuple of the form {ok, Pid}, where Pid is used for API calls to the server. Now, Erlang doesn?t have any good way of storing state, such as a variable to hold this Pid. So, If I have a function that every once in a while needs to call this API, but that API needs a Pid, and theres no way to get a Pid without starting a whole new server? how is this done? > Hi, Normally this is done in one of two ways (which really are the same but one is built-in). 1) You register the process with a unique name which is an atom. Either by yourself or by starting the gen_server as a named server. gen_server:start_link({local, my_name}, Module, Args, Options). Then: gen_server:call(my_name, hello). You can also register a pid with a name using erlang:register/2. {ok, Pid} = gen_server:start_link(Module, Args, Options), true = register(my_name, Pid). This is normally used when you have static gen_servers which you want to call throughout your code without caring about the pid. 2) You store the pid in a lookup registry of some sort and then lookup the pid before you call your gen_server. This is often done if you have more dynamic processes and process names or want to use something different than an atom to lookup the pid. The lookup registry in itself can be a named process (as per 1) where you can register and lookup your pids. It is a pretty good exercise to implement it. For example: {ok, Pid} = gen_server:start_link(Module, Args, Options), ok = my_registry:register(<<"whatevername">>, Pid) To call: {ok, Pid} = my_registry:lookup(<<"whatevername">>), gen_server:call(Pid, hello). There are a number of process registry libraries out there; gproc (https://github.com/uwiger/gproc) being one of the more well known. I'd start by implementing my own though as it gives you a better understanding how things work. I haven't looked it up but I think that learnyousomeerlang will bring up this subject too. From vances@REDACTED Fri Jul 28 07:32:33 2017 From: vances@REDACTED (Vance Shipley) Date: Fri, 28 Jul 2017 11:02:33 +0530 Subject: [erlang-questions] Accessing a gen_server function from another process In-Reply-To: <20036004-74A4-46B6-B8C1-379D6A3A402F@gmail.com> References: <20036004-74A4-46B6-B8C1-379D6A3A402F@gmail.com> Message-ID: On Fri, Jul 28, 2017 at 3:39 AM, code wiget wrote: > Generally, gen_server:start_link returns a tuple of the form {ok, Pid}, where Pid is used for API calls to the server. Now, Erlang doesn?t have any good way of storing state, such as a variable to hold this Pid. So, If I have a function that every once in a while needs to call this API, but that API needs a Pid, and theres no way to get a Pid without starting a whole new server? how is this done? In functional programming a function gets what it needs to know from it's arguments. The way you store state is to keep passing it around, like juggling balls. f() -> {ok, Pid} = gen_server:start(my_server, [], []), f1(PId). f1(Pid) -> ... f2(A, B, Pid). f2(A, B, Pid) -> ... OTP behaviour callbacks have a State argument which does just that, it keeps the state data in the air between calls. Need more than item of state? Make State a tuple(), map(), gb_tree:tree(), etc.. The easy way out is to register a process so other's can find it however that is not functional style. I prefer to arrange for each process to learn what it needs and keep it in state. A common design pattern is a supervisor with two children: a gen_server and a simple_one_for_one supervisor. The gen_server receives requests and calls supervisor:start_child/2 to start a worker, under it's sibling supervisor, to handle the request. You could register the supervisor so the server can use a hard coded name in start_child/2 but the lookup will need to be done each time. Instead I have the server call supervisor:which_children/1, to locate it's siblings, once after initialization. This requires that the server know the pid() of it's supervisor. How does it know that? You guessed it, it's passed as an argument from it's parent supervisor in gen_server:start_link/3. Many will argue that I'm being overly strict above, and that registered processes are just fine. Sure, but embracing functional style isn't that hard either. -- -Vance From v@REDACTED Fri Jul 28 08:23:01 2017 From: v@REDACTED (Valentin Micic) Date: Fri, 28 Jul 2017 08:23:01 +0200 Subject: [erlang-questions] Internal compiler atoms In-Reply-To: References: Message-ID: > > ?Is this anything that can be disabled?? > Say that there is, very soon you would be asking: why is there a limit on a number of atoms? Instead, you should write a code that does not generate 700k atoms. V/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From albin.stigo@REDACTED Fri Jul 28 08:43:34 2017 From: albin.stigo@REDACTED (=?UTF-8?B?QWxiaW4gU3RpZ8O2?=) Date: Fri, 28 Jul 2017 08:43:34 +0200 Subject: [erlang-questions] Internal compiler atoms In-Reply-To: References: Message-ID: 1. Try to avoid dynamically creating new atoms. 2. But I need to! Goto rule 1. 3. Dynamic atoms are not safe for long running code. You will eventually exhaust the atom table and this will lead to subtle bugs. 4. If you really DO need to create dynamic atoms for a quick and dirty hack, keep in mind that atoms with a common prefix ie. foo_1, foo_2, foo_3 etc will lead worse performance because of how erlang compares atoms (some Erlang guru correct me if I'm wrong but this used to be the case). --Albin On Fri, Jul 28, 2017 at 8:23 AM, Valentin Micic wrote: > > Is this anything that can be disabled? > > Say that there is, very soon you would be asking: why is there a limit on a > number of atoms? > Instead, you should write a code that does not generate 700k atoms. > > V/ > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From hawk.mattsson@REDACTED Fri Jul 28 09:22:37 2017 From: hawk.mattsson@REDACTED (=?UTF-8?Q?H=C3=A5kan_Mattsson?=) Date: Fri, 28 Jul 2017 09:22:37 +0200 Subject: [erlang-questions] Internal compiler atoms In-Reply-To: References: Message-ID: You must have mis-understood what I wrote. It is not my program that generates all those atoms. They are generated internally by the compiler while it is compiling my program from forms. The atoms my program are using do already exist in the forms data structure. I am very well aware of the +t flag. But it is quite boring to set it to 100M just to be able to compile. As I do not understand why the compiler dynamically generates all these internal atoms I cannot predict how big the atom table needs to be. In my latest run the compiler actually generated 25M atoms (which is 25 times the default size of the atom table). It surprised me. Please, do not come up with further suggestions about avoiding explicit creation of atoms in general. My question was much more specific. /H?kan On Jul 28, 2017 08:43, "Albin Stig?" wrote: 1. Try to avoid dynamically creating new atoms. 2. But I need to! Goto rule 1. 3. Dynamic atoms are not safe for long running code. You will eventually exhaust the atom table and this will lead to subtle bugs. 4. If you really DO need to create dynamic atoms for a quick and dirty hack, keep in mind that atoms with a common prefix ie. foo_1, foo_2, foo_3 etc will lead worse performance because of how erlang compares atoms (some Erlang guru correct me if I'm wrong but this used to be the case). --Albin On Fri, Jul 28, 2017 at 8:23 AM, Valentin Micic wrote: > > Is this anything that can be disabled? > > Say that there is, very soon you would be asking: why is there a limit on a > number of atoms? > Instead, you should write a code that does not generate 700k atoms. > > V/ > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From albin.stigo@REDACTED Fri Jul 28 09:33:21 2017 From: albin.stigo@REDACTED (=?UTF-8?B?QWxiaW4gU3RpZ8O2?=) Date: Fri, 28 Jul 2017 09:33:21 +0200 Subject: [erlang-questions] Internal compiler atoms In-Reply-To: References: Message-ID: H?kan, Interesting problem... not completely sure I understand it 100% then. What do you mean by "list of forms". How large is your module? I'm not sure why the compiler registers so many atoms but I guess it has to do with the compiler's internal representation of your module. I find "The BEAM book" to be a great resource when I run in to these kinds of problems: https://github.com/happi/theBeamBook --Albin On Fri, Jul 28, 2017 at 9:22 AM, H?kan Mattsson wrote: > You must have mis-understood what I wrote. > > It is not my program that generates all those atoms. They are generated > internally by the compiler while it is compiling my program from forms. The > atoms my program are using do already exist in the forms data structure. > > I am very well aware of the +t flag. But it is quite boring to set it to > 100M just to be able to compile. As I do not understand why the compiler > dynamically generates all these internal atoms I cannot predict how big the > atom table needs to be. In my latest run the compiler actually generated 25M > atoms (which is 25 times the default size of the atom table). It surprised > me. > > Please, do not come up with further suggestions about avoiding explicit > creation of atoms in general. My question was much more specific. > > /H?kan > > On Jul 28, 2017 08:43, "Albin Stig?" wrote: > > 1. Try to avoid dynamically creating new atoms. > > 2. But I need to! Goto rule 1. > > 3. Dynamic atoms are not safe for long running code. You will > eventually exhaust the atom table and this will lead to subtle bugs. > > 4. If you really DO need to create dynamic atoms for a quick and dirty > hack, keep in mind that atoms with a common prefix ie. foo_1, foo_2, > foo_3 etc will lead worse performance because of how erlang compares > atoms (some Erlang guru correct me if I'm wrong but this used to be > the case). > > > --Albin > > > On Fri, Jul 28, 2017 at 8:23 AM, Valentin Micic > wrote: >> >> Is this anything that can be disabled? >> >> Say that there is, very soon you would be asking: why is there a limit on >> a >> number of atoms? >> Instead, you should write a code that does not generate 700k atoms. >> >> V/ >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > From dszoboszlay@REDACTED Fri Jul 28 11:01:18 2017 From: dszoboszlay@REDACTED (=?UTF-8?Q?D=C3=A1niel_Szoboszlay?=) Date: Fri, 28 Jul 2017 09:01:18 +0000 Subject: [erlang-questions] os:cmd hang on OTP 18 In-Reply-To: References: Message-ID: I think I found the bug. After a fork/vfork the child process needs some initialisation. In case of vfork, this is done by executing the erl_child_setup program. In case of a fork however the setup code is in the same module, sys.c, where the fork happens. There are comments about how important is to keep erl_child_setup.c and the relevant parts of sys.c in sync. In OTP 18 erts began to use a new signal, ERTS_SYS_SUSPEND_SIGNAL internally. This signal is in fact SIGUSR2. The child process has to unblock all signals used by erts as part of its initialisation. And there's an inconsistency here between the vfork and fork cases: erl_child_setup.c does not unblock SIGUSR2. And it turns out that lbzip2 wants to use SIGUSR2 for communication between its worker processes, but this signal is blocked when we call it from Erlang's os:cmd (with vfork), so the program hangs. This patch to erts/emulator/sys/unix/erl_child_setup.c solved the problem: @@ -134,6 +134,7 @@ main(int argc, char *argv[]) sys_sigrelease(SIGCHLD); sys_sigrelease(SIGINT); sys_sigrelease(SIGUSR1); + sys_sigrelease(SIGUSR2); if (erts_spawn_executable) { if (argv[CS_ARGV_NO_OF_ARGS + 1] == NULL) { Daniel On Thu, 27 Jul 2017 at 09:21 D?niel Szoboszlay wrote: > Thanks Dmytro, this really helped a lot! > > I think the commit you pointed to is not directly related: it only changes > Erlang code, and if the behaviour depends on whether you are using a > release/debug build, the root cause is most probably somewhere in the C > code of erts. > > But the commit message talks about the emulator no longer using vfork, and > it was a good clue: disabling vfork on 18 prevents the problem. So this one > will finish: > > ERL_NO_VFORK=true erl +A0 +S 1:1 -noinput -noshell -eval 'os:cmd("tar -C > /tmp/ -xf /tmp/tartest --use-compress-program=lbzip2"), init:stop().' > > Thanks again for the clue, I will look into the difference between using > fork/vfork in OTP 18! > > Daniel > > On Thu, 27 Jul 2017 at 02:09 Dmytro Lytovchenko < > dmytro.lytovchenko@REDACTED> wrote: > >> I could observe the behaviour only in R18, but not in R19 and not in R20 >> I also could not reproduce it in debug flavour of R18 emulator, but it >> reproduces reliably in release SMP variant. >> >> The changes to os.erl between 18.3.4.5 and 19.0 include removal of os:cmd >> server which might somehow be related (commit >> *200247f972b012ced0c4b2c6611f091af66ebedd*). This commit *possibly* >> fixes the behavior ? in R19 (build 19.0 by Kerl) the behaviour does not >> happen. >> >> 2017-07-26 21:47 GMT+02:00 D?niel Szoboszlay : >> >>> Honestly, I didn't try with other command variations. There are many >>> commands that do not hang when run from os:cmd, regardless of the OTP >>> version. But this particular command does hang with one OTP version, and >>> not with the other OTP version. So the difference is in OTP, and I want to >>> find out what has changed. >>> >>> Daniel >>> >>> On Wed, 26 Jul 2017 at 21:34 Dmytro Lytovchenko < >>> dmytro.lytovchenko@REDACTED> wrote: >>> >>>> Is it something lbzip2 related? >>>> Did you try normal single-thread bzip2? (-j flag or --bzip2) >>>> What is you use gzip? (-z or --gzip) >>>> >>>> 2017-07-26 21:27 GMT+02:00 D?niel Szoboszlay : >>>> >>>>> Hi, >>>>> >>>>> I've encountered a strange problem with os:cmd when running tar and >>>>> lbzip2. Steps to reproduce: >>>>> >>>>> # create some lbzip2 compressed data >>>>> >>>>> dd if=/dev/urandom of=/tmp/testfile count=10 >>>>> tar -cf - -C /tmp testfile | lbzip2 -6 -n 4 | dd of=/tmp/tartest status=none >>>>> >>>>> >>>>> # try to extract the archive from Erlang with os:cmd >>>>> >>>>> erl -noinput -eval 'os:cmd("tar -C /tmp/ -xf /tmp/tartest --use-compress-program=lbzip2"), init:stop().' >>>>> >>>>> >>>>> This worked fine with OTP 17.5.6.7, but with OTP 18.3.4.5 the command >>>>> hangs: lbzip2 just sits in a rt_sigsuspend syscall waiting for a USR2, PIPE >>>>> or XFSZ signal. And its parent, the tar process waits in a wait4 syscall >>>>> for lbzip2 to terminate. >>>>> >>>>> I don't have at the moment any newer OTP version installed, I'm not >>>>> sure how OTP 19 or 20 would behave. >>>>> >>>>> I tried to strace the processes, but there's too much noise, I >>>>> couldn't yet figure out anything interesting there. >>>>> >>>>> I also tried to diff OTP 17 & 18, but os:cmd/1 and friends didn't >>>>> change. I'm not sure about the port code, but at least the release notes >>>>> didn't mention anything major. Or did I miss something? Does anyone have an >>>>> idea what may have changed between these OTP versions? >>>>> >>>>> Thanks, >>>>> Daniel >>>>> >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>> >>>>> >>>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikpelinux@REDACTED Fri Jul 28 11:48:57 2017 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Fri, 28 Jul 2017 11:48:57 +0200 Subject: [erlang-questions] os:cmd hang on OTP 18 In-Reply-To: References: Message-ID: <22907.2185.142881.45152@gargle.gargle.HOWL> D?niel Szoboszlay writes: > I think I found the bug. After a fork/vfork the child process needs some > initialisation. In case of vfork, this is done by executing the > erl_child_setup program. In case of a fork however the setup code is in the > same module, sys.c, where the fork happens. There are comments about how > important is to keep erl_child_setup.c and the relevant parts of sys.c in > sync. > > In OTP 18 erts began to use a new signal, ERTS_SYS_SUSPEND_SIGNAL > internally. This signal is in fact SIGUSR2. The child process has to > unblock all signals used by erts as part of its initialisation. And there's > an inconsistency here between the vfork > > and fork > > cases: erl_child_setup.c does not unblock SIGUSR2. > > And it turns out that lbzip2 wants to use SIGUSR2 for communication between > its worker processes, but this signal is blocked when we call it from > Erlang's os:cmd (with vfork), so the program hangs. > > This patch to erts/emulator/sys/unix/erl_child_setup.c solved the problem: > > @@ -134,6 +134,7 @@ main(int argc, char *argv[]) > sys_sigrelease(SIGCHLD); > sys_sigrelease(SIGINT); > sys_sigrelease(SIGUSR1); > + sys_sigrelease(SIGUSR2); > > if (erts_spawn_executable) { > if (argv[CS_ARGV_NO_OF_ARGS + 1] == NULL) { > > > Daniel Nice find. This matters because the subsequent exec only resets caught signals (since their handlers would disappear), while blocked signals remain blocked breaking the child's expectations. > > On Thu, 27 Jul 2017 at 09:21 D?niel Szoboszlay > wrote: > > > Thanks Dmytro, this really helped a lot! > > > > I think the commit you pointed to is not directly related: it only changes > > Erlang code, and if the behaviour depends on whether you are using a > > release/debug build, the root cause is most probably somewhere in the C > > code of erts. > > > > But the commit message talks about the emulator no longer using vfork, and > > it was a good clue: disabling vfork on 18 prevents the problem. So this one > > will finish: > > > > ERL_NO_VFORK=true erl +A0 +S 1:1 -noinput -noshell -eval 'os:cmd("tar -C > > /tmp/ -xf /tmp/tartest --use-compress-program=lbzip2"), init:stop().' > > > > Thanks again for the clue, I will look into the difference between using > > fork/vfork in OTP 18! > > > > Daniel > > > > On Thu, 27 Jul 2017 at 02:09 Dmytro Lytovchenko < > > dmytro.lytovchenko@REDACTED> wrote: > > > >> I could observe the behaviour only in R18, but not in R19 and not in R20 > >> I also could not reproduce it in debug flavour of R18 emulator, but it > >> reproduces reliably in release SMP variant. > >> > >> The changes to os.erl between 18.3.4.5 and 19.0 include removal of os:cmd > >> server which might somehow be related (commit > >> *200247f972b012ced0c4b2c6611f091af66ebedd*). This commit *possibly* > >> fixes the behavior ? in R19 (build 19.0 by Kerl) the behaviour does not > >> happen. > >> > >> 2017-07-26 21:47 GMT+02:00 D?niel Szoboszlay : > >> > >>> Honestly, I didn't try with other command variations. There are many > >>> commands that do not hang when run from os:cmd, regardless of the OTP > >>> version. But this particular command does hang with one OTP version, and > >>> not with the other OTP version. So the difference is in OTP, and I want to > >>> find out what has changed. > >>> > >>> Daniel > >>> > >>> On Wed, 26 Jul 2017 at 21:34 Dmytro Lytovchenko < > >>> dmytro.lytovchenko@REDACTED> wrote: > >>> > >>>> Is it something lbzip2 related? > >>>> Did you try normal single-thread bzip2? (-j flag or --bzip2) > >>>> What is you use gzip? (-z or --gzip) > >>>> > >>>> 2017-07-26 21:27 GMT+02:00 D?niel Szoboszlay : > >>>> > >>>>> Hi, > >>>>> > >>>>> I've encountered a strange problem with os:cmd when running tar and > >>>>> lbzip2. Steps to reproduce: > >>>>> > >>>>> # create some lbzip2 compressed data > >>>>> > >>>>> dd if=/dev/urandom of=/tmp/testfile count=10 > >>>>> tar -cf - -C /tmp testfile | lbzip2 -6 -n 4 | dd of=/tmp/tartest status=none > >>>>> > >>>>> > >>>>> # try to extract the archive from Erlang with os:cmd > >>>>> > >>>>> erl -noinput -eval 'os:cmd("tar -C /tmp/ -xf /tmp/tartest --use-compress-program=lbzip2"), init:stop().' > >>>>> > >>>>> > >>>>> This worked fine with OTP 17.5.6.7, but with OTP 18.3.4.5 the command > >>>>> hangs: lbzip2 just sits in a rt_sigsuspend syscall waiting for a USR2, PIPE > >>>>> or XFSZ signal. And its parent, the tar process waits in a wait4 syscall > >>>>> for lbzip2 to terminate. > >>>>> > >>>>> I don't have at the moment any newer OTP version installed, I'm not > >>>>> sure how OTP 19 or 20 would behave. > >>>>> > >>>>> I tried to strace the processes, but there's too much noise, I > >>>>> couldn't yet figure out anything interesting there. > >>>>> > >>>>> I also tried to diff OTP 17 & 18, but os:cmd/1 and friends didn't > >>>>> change. I'm not sure about the port code, but at least the release notes > >>>>> didn't mention anything major. Or did I miss something? Does anyone have an > >>>>> idea what may have changed between these OTP versions? > >>>>> > >>>>> Thanks, > >>>>> Daniel > >>>>> > >>>>> _______________________________________________ > >>>>> erlang-questions mailing list > >>>>> erlang-questions@REDACTED > >>>>> http://erlang.org/mailman/listinfo/erlang-questions > >>>>> > >>>>> > >>>> > >> > > ---------------------------------------------------------------------- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- From krzysztof.jurewicz@REDACTED Fri Jul 28 14:46:32 2017 From: krzysztof.jurewicz@REDACTED (Krzysztof Jurewicz) Date: Fri, 28 Jul 2017 14:46:32 +0200 Subject: [erlang-questions] Writing a cryptocurrency in Erlang Message-ID: <87lgn820gn.fsf@gmail.com> Hello, I?ve been writing a new cryptocurrency in Erlang. In this post I?m going to describe design goals, current status etc., in order to get some Erlang community feedback, merge it with other feedback, estimate potential community involvement and decide what to do next. No detailed cryptocurrency knowledge is assumed; please ask questions in case something is hard to understand. Comments are appreciated. Below is a plain text version of the post. For other formats, with hyperlinks, see dat://0284a58ef3a03bd6628720934e3628b3ea748384f98a8c76006a67264d3de00d/ or https://datproject.org/dat://0284a58ef3a03bd6628720934e3628b3ea748384f98a8c76006a67264d3de00d/ Table of contents: 1. Why Erlang for a new cryptocurrency? 2. Why a new cryptocurrency at all? 3. Current status, design goals and challenges 4. Initial coin distribution 5. Development model 6. Name Why Erlang for a new cryptocurrency? Erlang has features that make it apparently a perfect match for writing cryptocurrencies. Among them are: - Great support for concurrency. A cryptocurrency network is a set of many nodes that send themselves messages asynchronously. This can be naturally modelled in Erlang. - Libraries for creating state machines. A cryptocurrency is basically a decentralized state machine. - Bit syntax, making it easy to handle protocol messages. Personally I?m a bit amazed that Erlang has not yet been used as a cryptocurrency basis. Why a new cryptocurrency at all? According to coinmarketcap.com, there are at least 831 cryptocurrencies in existence and new ones are coming (in many cases containing new features). However they usually suffer from a number of deficiencies. Let?s list some of them. Energy inefficiency of proof of work cryptocurrencies Bitcoin groups transactions into blocks which form a chain and the actual problem it solves is: given there may be many alternative valid block chains, which one is binding? The answer is: binding is the block chain with the most work invested. How is it implemented? To create a block, (simplifying) you have to find a nonce which, when hashed with some given data, yields a hash low enough (?enough? is adjusted so that blocks are created every 10 minutes on average). Therefore one could say that Bitcoin ?miners? participate in a lottery and each nonce is one lottery ticket; the more computational power you have, the more nonces you are able to check and therefore the more lottery tickets you have. This is a solution both elegant and inefficient, as there are no limits on how many nonces can be tried, hence many computational resources are invested to meet economic incentives given. On the other hand, if there are little incentives, it would be relatively cheap to attack the cryptocurrency. Low entropy of proof of stake cryptocurrencies To not perform ?wasteful? computations, a simple restriction has been proposed: instead of freely chosen nonces, money addresses (simplifying) are used in that role and hash threshold values are proportional to the amount of coins an address holds. Therefore the set of lottery tickets is very limited, with the currency itself playing the role of a scarce resource instead of computational power. A side effect is that attacking the currency is much more expensive and generally unprofitable (as it would ruin the value of coins used to perform the attack). The first free, fairly distributed (i.e. with no privileged entities) cryptocurrency which has been using this algorithm is Peercoin. The first such cryptocurrency using proof of stake in 100% is BlackCoin. The problem here is the following: how is the common hashed data chosen? It turns out it is usually generated deterministically from the data stored in the blockchain in some obfuscated way. However, since block creators can choose data which is put in the blocks, they can possibly try to manipulate that data in their favor. In other words, if we want to draw addresses that are entitled to generate blocks, we need a good source of entropy and getting entropy bits from non-random data over which people have some degree of control raises many concerns. Inflexible economic models Bitcoin creates one 1MB block around every 10 minutes, therefore transaction volume is limited to around 100 KB/minute. Currently it means that high fees need to be paid to get a transaction confirmed, but in case of low demand it would mean that fees too low would be paid (as fee income is given totally to the block creator, but transaction-induced costs are distributed on the network nodes). To make things worse, there is a portion, lowering in time, of newly-created coins in every Bitcoin block which are also given to the miner. Currently this causes more mining power to be used and when it diminishes, it may happen that there is many unused mining power left, creating some security threat. Complexity Bitcoin is not as simple as sending money from address A to address B. Instead, each transaction creates at least one so-called unspent transaction output with an associated script (written in a stack-based language). To spend an output, one needs to provide an input to its script so that the script returns true. Usually it means just proving that one is an owner of an address, but using a programming language adds some complexity with not so much benefits. There are also more ambitious cryptocurrencies like Ethereum which aim to generalize cryptocurrencies to allow performing arbitrary, decentralized computations in Turing-complete environments. Possible bloat Currently one can create an unspent transaction output in Bitcoin which contains just one satoshi (0.00000001 BTC) and it will stay in the blockchain forever. Unfair distribution Bitcoin has been distributed fairly, i.e. proportionally to the computational power invested; no entity has been privileged. However this does not apply to all cryptocurrencies. Some of them are premined (the developer grants some amount of coins to himself) and in some the developer sells some amount of coins during a so called Initial Coin Offering (ICO). As an extreme example of the former, consider a situation where developer premines 99% of coins. He then has powerful means to manipulate the price. The latter seems to be problematic in particular because it is hard to determine whether the developer is not ?buying from himself?. To create a big community supporting a cryptocurrency, fair distribution seems to be an important issue. Current status, design goals and challenges I?ve written a (mostly functional) cryptocurrency prototype using Tendermint. Tendermint (written in Go) is a consensus engine, i.e. it handles order of transactions, gossiping and creating blocks, while a programmer can focus on writing a state machine. State machine is bridged with Tendermint by abci_server using Protocol Buffers. Besides other advantages, every block in Tendermint needs to be signed by at least 2/3 of the so-called validators, hence there are no possible forks from main chain. Therefore a transaction is either confirmed or not, instead of Bitcoin?s ?a transaction has n confirmations?. This allows some significant simplifications to be made. The state machine is written using gen_statem and tested using Triq. Its code is currently nearly 2000 lines, with tests being about 2 times longer than the implementation. Small part (calculation of quantiles) is written in LFE. gb_merkle_trees library acts as a primary database and there is currently no cache, which makes the application easy to test (as there is no hidden state), but may eventually lead to scalability problems. I hope that it won?t happen sooner than before gaining significant popularity though; a general balanced Merkle tree consisting of 100,000 random 32-byte keys and 32-byte values takes about 18 megabytes when serialized to binary and it took about 15 ms to find the biggest value using Intel Core i5-5200U. State transition logic aims to be simple, as there is nothing inherently complicated in money sending. Therefore there is no scripting language. Instead, a few types of transactions are present which do the most needed tasks and money is associated with addresses/accounts, similarly as in a banking system. In some cases it may be necessary to create addresses managed not by a single key, but by an arbitrary combination of keys. For example, a company may want to allow its balance to be spent either by its chairman or by at least two board members. This, in non-complex cases, can be achieved by allowing addresses to be not only public keys, but also root hashes of Merkle trees containing all authorized public keys, combined with Schnorr signatures? feature of combining multiple public keys and signatures. A simple wallet is written as a separate EScript (production wallet can be written in another language). Tendermint acts as a bridge between the wallet and a node holding the state. To make the economic structure adaptive, dynamic transaction fees decided by consensus are going to be used. Fees from blocks should not be distributed only to block creators, so they cannot service themselves for free. The topic of economic incentives is already covered in the implementation, but it needs to be redesigned. The problem with Tendermint is that it doesn?t solve the entropy problem. This can be solved using publicly verifiable secret sharing; the repository pvss-haskell used in Cardano has few lines of code, so (assuming it contains complete implementations) it should not be very difficult to implement. However in the initial phase the problem can be bypassed by using the NIST Randomness Beacon. Later a source of verifiable entropy can be picked, maybe outside of the cryptocurrency itself. See the paper ?A random zoo: sloth, unicorn, and trx? for a discussion of some possible options. Solving the entropy problem will need some changes in Tendermint. The same applies to implementing an incentive model (see the last release note for 0.10 version). In general, a question can be asked whether a custom consensus engine written in Erlang would not be better in the long term. Distribution To achieve fair distribution (i.e. a distribution with no entity privileged), I propose to use proof of burn, that is, people will get a portion of the initial distribution of coins proportional to the amount of another cryptocurrency they destroyed in a selected period. I propose to burn BlackCoin, as it has been fairly distributed and is the first free and 100% proof of stake coin (besides that, it already has a command for burning coins). I?ve written a simple program that can be used to list burnt outputs. Development Nothing fascinating in this topic, but some choices have to be made. I propose the following: - Apache 2.0 as the license. - GitLab for repository hosting and issue tracking. GitHub is more popular, but GitLab is free, functional, has a praised CI and seems to be more neutral as a company, so why not give it a try (maybe with a GitHub mirror)? - IRC for eventual chat. Slack is proprietary and has an official web client available only for a few selected browsers, making it an unfortunate choice for a free project. Perhaps Mattermost can be considered as an alternative. Name Ercoin? KJCoin? Any other ideas? -- Krzysztof Jurewicz http://jurewicz.org.pl From hawk.mattsson@REDACTED Fri Jul 28 15:16:07 2017 From: hawk.mattsson@REDACTED (=?UTF-8?Q?H=C3=A5kan_Mattsson?=) Date: Fri, 28 Jul 2017 15:16:07 +0200 Subject: [erlang-questions] Internal compiler atoms In-Reply-To: References: Message-ID: See http://erlang.org/doc/man/compile.html#noenv_forms-2 about forms. My module is quite large. The compressed beam-file is about 45MB. But that is besides the point. It does not explain why the atoms are generated. /H?kan On Fri, Jul 28, 2017 at 9:33 AM, Albin Stig? wrote: > H?kan, > > Interesting problem... not completely sure I understand it 100% then. > What do you mean by "list of forms". How large is your module? > > I'm not sure why the compiler registers so many atoms but I guess it > has to do with the compiler's internal representation of your module. > > I find "The BEAM book" to be a great resource when I run in to these > kinds of problems: > https://github.com/happi/theBeamBook > > > --Albin > > On Fri, Jul 28, 2017 at 9:22 AM, H?kan Mattsson > wrote: > > You must have mis-understood what I wrote. > > > > It is not my program that generates all those atoms. They are generated > > internally by the compiler while it is compiling my program from forms. > The > > atoms my program are using do already exist in the forms data structure. > > > > I am very well aware of the +t flag. But it is quite boring to set it to > > 100M just to be able to compile. As I do not understand why the compiler > > dynamically generates all these internal atoms I cannot predict how big > the > > atom table needs to be. In my latest run the compiler actually generated > 25M > > atoms (which is 25 times the default size of the atom table). It > surprised > > me. > > > > Please, do not come up with further suggestions about avoiding explicit > > creation of atoms in general. My question was much more specific. > > > > /H?kan > > > > On Jul 28, 2017 08:43, "Albin Stig?" wrote: > > > > 1. Try to avoid dynamically creating new atoms. > > > > 2. But I need to! Goto rule 1. > > > > 3. Dynamic atoms are not safe for long running code. You will > > eventually exhaust the atom table and this will lead to subtle bugs. > > > > 4. If you really DO need to create dynamic atoms for a quick and dirty > > hack, keep in mind that atoms with a common prefix ie. foo_1, foo_2, > > foo_3 etc will lead worse performance because of how erlang compares > > atoms (some Erlang guru correct me if I'm wrong but this used to be > > the case). > > > > > > --Albin > > > > > > On Fri, Jul 28, 2017 at 8:23 AM, Valentin Micic > > wrote: > >> > >> Is this anything that can be disabled? > >> > >> Say that there is, very soon you would be asking: why is there a limit > on > >> a > >> number of atoms? > >> Instead, you should write a code that does not generate 700k atoms. > >> > >> V/ > >> > >> > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-questions > >> > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.hogberg@REDACTED Fri Jul 28 16:18:19 2017 From: john.hogberg@REDACTED (=?iso-8859-1?Q?John_H=F6gberg?=) Date: Fri, 28 Jul 2017 14:18:19 +0000 Subject: [erlang-questions] Patch Package OTP 19.3.6.2 Released In-Reply-To: References: Message-ID: Patch Package: OTP 19.3.6.2 Git Tag: OTP-19.3.6.2 Date: 2017-07-28 Trouble Report Id: OTP-14491, OTP-14509, OTP-14514 Seq num: System: OTP Release: 19 Application: erts-8.3.5.2 Predecessor: OTP 19.3.6.1 Check out the git tag OTP-19.3.6.2, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- erts-8.3.5.2 ---------------------------------------------------- --------------------------------------------------------------------- Note! The erts-8.3.5.2 application can *not* be applied independently of other applications on an arbitrary OTP 19 installation. On a full OTP 19 installation, also the following runtime dependency has to be satisfied: -- sasl-3.0.1 (first satisfied in OTP 19.1) --- Fixed Bugs and Malfunctions --- OTP-14491 Application(s): erts Fix performance bug in pre-allocators that could cause them to permanently fall back on normal more expensive memory allocation. Pre-allocators are used for quick allocation of short lived meta data used by messages and other scheduled tasks. Bug exists since OTP_R15B02. OTP-14509 Application(s): erts Fixed a bug that prevented TCP sockets from being closed properly on send timeouts. OTP-14514 Application(s): erts Fixed bug in operator bxor causing erroneuos result when one operand is a big *negative* integer with the lowest N*W bits as zero and the other operand not larger than N*W bits. N is an integer of 1 or larger and W is 32 or 64 depending on word size. Full runtime dependencies of erts-8.3.5.2: kernel-5.0, sasl-3.0.1, stdlib-3.0 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From freza@REDACTED Fri Jul 28 16:44:57 2017 From: freza@REDACTED (Jachym Holecek) Date: Fri, 28 Jul 2017 10:44:57 -0400 Subject: [erlang-questions] Internal compiler atoms In-Reply-To: References: Message-ID: <20170728144457.GA3707@circlewave.net> # H?kan Mattsson 2017-07-27: > In this case the compiler itself generated more than 300K atoms while > compiling my forms. > > Why is the atoms generated? Names for variables introduced by the compiler. Names for functions introduced by the compiler. Some of this seems to happen in v3_core, have a look at new_fun_name/2 + new_var_name/1 and follow their callers. There seems to be more besides v3_core, too. > Is this anything that can be disabled? Probably not, but ask a compiler expert. ;-) BR, -- Jachym From dmorneau@REDACTED Fri Jul 28 16:54:15 2017 From: dmorneau@REDACTED (Dominic Morneau) Date: Fri, 28 Jul 2017 23:54:15 +0900 Subject: [erlang-questions] Internal compiler atoms In-Reply-To: References: Message-ID: Since you have a crash dump, you could check: sed -ne '/=atoms/,$p' < erl_crash.dump | head -n 100 That would show the last 100 atoms created before the crash, which might help figure out what's up. Dominic 2017?7?27?(?) 23:19 H?kan Mattsson : > > I am trying to compile a > ?(? > big > ?)? > module from a list of forms > ?? > , but it seems > ? like the compiler internally generates lots of new atoms:? > > > no more index entries in atom_tab (max=1048576) > > Crash dump is being written to: erl_crash.dump... > > ?In this case the compiler itself generated ?more than 300K atoms while > compiling my forms. > ? > ?Why is the atoms generated?? > > ?Is this anything that can be disabled?? > > /H?kan > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wallentin.dahlberg@REDACTED Sat Jul 29 15:18:22 2017 From: wallentin.dahlberg@REDACTED (=?UTF-8?Q?Bj=C3=B6rn=2DEgil_Dahlberg?=) Date: Sat, 29 Jul 2017 15:18:22 +0200 Subject: [erlang-questions] Internal compiler atoms In-Reply-To: References: Message-ID: All identifiers, i.e. variables and function names, are represented as atoms internally in the compiler. In addition to your own variables, temporaries are also generated in core and kernel. These are also identifiers and therefor also atoms. This means we can't really predict how many atoms will be generated either. And No, there is no real need for these to be represented as atoms. It would be better if they were binaries imho. I guess the original author(s) of the compiler never expected huge a huge number of atoms being generated. The remedy is to rewrite the compiler internals to use binary strings instead of atoms for identifiers. That goes for the whole chain of things, tokinizer, parser, linter, forms, core, kernel and beam. Happy hacking. :) // Bj?rn-Egil 2017-07-27 16:19 GMT+02:00 H?kan Mattsson : > > I am trying to compile a > ?(? > big > ?)? > module from a list of forms > ?? > , but it seems > ? like the compiler internally generates lots of new atoms:? > > > no more index entries in atom_tab (max=1048576) > > Crash dump is being written to: erl_crash.dump... > > ?In this case the compiler itself generated ?more than 300K atoms while > compiling my forms. > ? > ?Why is the atoms generated?? > > ?Is this anything that can be disabled?? > > /H?kan > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Sat Jul 29 22:23:42 2017 From: lloyd@REDACTED (lloyd@REDACTED) Date: Sat, 29 Jul 2017 16:23:42 -0400 (EDT) Subject: [erlang-questions] mnesia -- a naive question Message-ID: <1501359822.197832204@apps.rackspace.com> Hello, Wasabi is a new cloud storage service that promotes lower storage costs and greater speed than Amazon S3: https://wasabi.com/ During the dev phase I'm running mnesia on the back-end of my current web project. I much like the seamless way that mnesia integrates into Erlang as well as its replication feature. But folks have warned about the hassles of mnesia net splits. Problem is that I have no operations experience to objectively weigh options. But I do want to bridge over all points of failure as cost-and-time-effectively as possible. So, my question is if and how I can integrate Wasabi (or Amazon S3 for that matter) into my operation to significantly reduce the probability of data loss? Many thanks, LRP From jesper.louis.andersen@REDACTED Sun Jul 30 15:13:28 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sun, 30 Jul 2017 13:13:28 +0000 Subject: [erlang-questions] mnesia -- a naive question In-Reply-To: <1501359822.197832204@apps.rackspace.com> References: <1501359822.197832204@apps.rackspace.com> Message-ID: A couple of points: * Mnesia protects you against the scenario where one of your nodes fail. It doesn't automatically protect you against the network splitting, and requires some manual recovery on the flip side of such an event. For rather small clusters, this is manageable by manual operation. Larger systems will be far harder to maintain because the risk of netsplits and node loss goes up whenever you add a new node. * I don't know about Wasabi, but Amazon's EC2 nodes are ephemeral in the sense they can go away at a moments notice. And when this happens, the data on the node is gone. Thus, to achieve persistent storage, you must either store data off the EC2 node, presumably in S3, RDS, DynamoDB and so on. Or use an EBS volume, attached to the EC2 node to provide persistent disk space (on which your mnesia database can reside). * The game is all about risk mitigation. If you regularly take a mnesia backup and store it into S3, or something like it, you can get speedy recovery to that point in time should the accident happen. If you want better point-in-time-recovery, you can try running two mnesia nodes, but you need to heed two important caveats: - You probably want your nodes to run in different zones so a failure in one zone doesn't take down everything. - Amazons network is brittle and likely to drop connections which are seen as netsplits. * Mnesia mitigates risk by assuming the nodes are fairly robust and stable, as well as the network between them. If you buy good expensive hardware, this is a likely assumption and the noise of error will be low. So manual intervention in the case of an error is probably what is needed anyway (to fix the faulty hardware as well). * Amazon and other leased environments tend to have brittle network connections and flaky machines. To mitigate this, your system must make no assumptions about stability and handle this up front. Mnesia wasn't really built to work in such an environment. On Sat, Jul 29, 2017 at 10:23 PM wrote: > Hello, > > Wasabi is a new cloud storage service that promotes lower storage costs > and greater speed than Amazon S3: > > https://wasabi.com/ > > During the dev phase I'm running mnesia on the back-end of my current web > project. I much like the seamless way that mnesia integrates into Erlang as > well as its replication feature. But folks have warned about the hassles of > mnesia net splits. > > Problem is that I have no operations experience to objectively weigh > options. But I do want to bridge over all points of failure as > cost-and-time-effectively as possible. > > So, my question is if and how I can integrate Wasabi (or Amazon S3 for > that matter) into my operation to significantly reduce the probability of > data loss? > > > Many thanks, > > LRP > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Sun Jul 30 21:33:14 2017 From: lloyd@REDACTED (lloyd@REDACTED) Date: Sun, 30 Jul 2017 15:33:14 -0400 (EDT) Subject: [erlang-questions] mnesia -- a naive question In-Reply-To: References: <1501359822.197832204@apps.rackspace.com> Message-ID: <1501443194.391423862@apps.rackspace.com> Hi Jesper, Your points are reassuring. Thank you. Wasabi promotes their site as 6x faster and 1/5th the cost of Amazon S3. In the spirit of due diligence my next steps are: 1. Do upload/recovery tests with large files to see minimal likely time for recovery 2. Visit Wasabi to check them out. They're in Boston so easy to do 3. For dev/testing/very early production I'm thinking of hosting two or maybe three Erlang Nitrogen + mnesia servers in house 4. See if I can come up with a script to detect outage and initiate recovery 5. This doesn't address replication across Zones, but one step at a time I had been considering Riak KV, but this seems easier to implement with less overhead. I still have many questions. But I'm months from actual beta launch, so this plan at least provides a starting point for critique and refinement. Wish me luck. All the best, Lloyd -----Original Message----- From: "Jesper Louis Andersen" Sent: Sunday, July 30, 2017 9:13am To: lloyd@REDACTED, "Erlang" Subject: Re: [erlang-questions] mnesia -- a naive question A couple of points: * Mnesia protects you against the scenario where one of your nodes fail. It doesn't automatically protect you against the network splitting, and requires some manual recovery on the flip side of such an event. For rather small clusters, this is manageable by manual operation. Larger systems will be far harder to maintain because the risk of netsplits and node loss goes up whenever you add a new node. * I don't know about Wasabi, but Amazon's EC2 nodes are ephemeral in the sense they can go away at a moments notice. And when this happens, the data on the node is gone. Thus, to achieve persistent storage, you must either store data off the EC2 node, presumably in S3, RDS, DynamoDB and so on. Or use an EBS volume, attached to the EC2 node to provide persistent disk space (on which your mnesia database can reside). * The game is all about risk mitigation. If you regularly take a mnesia backup and store it into S3, or something like it, you can get speedy recovery to that point in time should the accident happen. If you want better point-in-time-recovery, you can try running two mnesia nodes, but you need to heed two important caveats: - You probably want your nodes to run in different zones so a failure in one zone doesn't take down everything. - Amazons network is brittle and likely to drop connections which are seen as netsplits. * Mnesia mitigates risk by assuming the nodes are fairly robust and stable, as well as the network between them. If you buy good expensive hardware, this is a likely assumption and the noise of error will be low. So manual intervention in the case of an error is probably what is needed anyway (to fix the faulty hardware as well). * Amazon and other leased environments tend to have brittle network connections and flaky machines. To mitigate this, your system must make no assumptions about stability and handle this up front. Mnesia wasn't really built to work in such an environment. On Sat, Jul 29, 2017 at 10:23 PM wrote: > Hello, > > Wasabi is a new cloud storage service that promotes lower storage costs > and greater speed than Amazon S3: > > https://wasabi.com/ > > During the dev phase I'm running mnesia on the back-end of my current web > project. I much like the seamless way that mnesia integrates into Erlang as > well as its replication feature. But folks have warned about the hassles of > mnesia net splits. > > Problem is that I have no operations experience to objectively weigh > options. But I do want to bridge over all points of failure as > cost-and-time-effectively as possible. > > So, my question is if and how I can integrate Wasabi (or Amazon S3 for > that matter) into my operation to significantly reduce the probability of > data loss? > > > Many thanks, > > LRP > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From jesper.louis.andersen@REDACTED Sun Jul 30 21:58:21 2017 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Sun, 30 Jul 2017 19:58:21 +0000 Subject: [erlang-questions] mnesia -- a naive question In-Reply-To: <1501443194.391423862@apps.rackspace.com> References: <1501359822.197832204@apps.rackspace.com> <1501443194.391423862@apps.rackspace.com> Message-ID: I often recommend people to crawl before walk before run before fly before teleport. Mnesia is a fine choice due to the low impedance. Just store Erlang terms and you are up and running. As long as you are trying to validate a product or a solution, it is more important to move fast than it is to worry too much about operational problems. The reason is that your data size is likely to be small and thus it is fairly easy to just restore everything. Once you are more established and have a valid proof-of-concept, you can start looking into a solution that has better durability and resilience. The key aspect is to design your system with this change and extension in mind: if you plan on using something like Riak, which is AP and has no transactions, your current solution shouldn't rely too much on those kinds of things. A Postgresql instance is likely to work fine up to a couple dozen terabytes as well. On the other hand: Mnesia seems to have served Klarna well. And their business is likely to be far larger than yours for the coming years. So perhaps one can scale a Mnesia based system somewhat easily while keeping the system operational. A key observation is that a modern server is so friggin' large we cut them up into small pieces and leased out small pieces as virtual machines: most systems doesn't need a full machine anymore. But it also means that vertical scaling is likely to work up to a point that is far greater than earlier on. As for operations: almost all of Google's SRE handbook is worth studying. In this particular case, you want to have a target availability set before you deploy the system. Are you going for 99.9% uptime over 3 months, or more? Most systems are actually fine around 99% and well-designed Erlang systems are likely to give you more than that in the software, leaving most errors to be hardware faults. At 99% you usually have ample time to recover. On Sun, Jul 30, 2017 at 9:33 PM wrote: > Hi Jesper, > > Your points are reassuring. Thank you. > > Wasabi promotes their site as 6x faster and 1/5th the cost of Amazon S3. > In the spirit of due diligence my next steps are: > > 1. Do upload/recovery tests with large files to see minimal likely time > for recovery > 2. Visit Wasabi to check them out. They're in Boston so easy to do > 3. For dev/testing/very early production I'm thinking of hosting two or > maybe three Erlang Nitrogen + mnesia servers in house > 4. See if I can come up with a script to detect outage and initiate > recovery > 5. This doesn't address replication across Zones, but one step at a time > > I had been considering Riak KV, but this seems easier to implement with > less overhead. > > I still have many questions. But I'm months from actual beta launch, so > this plan at least provides a starting point for critique and refinement. > > Wish me luck. > > All the best, > > Lloyd > > -----Original Message----- > From: "Jesper Louis Andersen" > Sent: Sunday, July 30, 2017 9:13am > To: lloyd@REDACTED, "Erlang" > Subject: Re: [erlang-questions] mnesia -- a naive question > > A couple of points: > > * Mnesia protects you against the scenario where one of your nodes fail. It > doesn't automatically protect you against the network splitting, and > requires some manual recovery on the flip side of such an event. For rather > small clusters, this is manageable by manual operation. Larger systems will > be far harder to maintain because the risk of netsplits and node loss goes > up whenever you add a new node. > > * I don't know about Wasabi, but Amazon's EC2 nodes are ephemeral in the > sense they can go away at a moments notice. And when this happens, the data > on the node is gone. Thus, to achieve persistent storage, you must either > store data off the EC2 node, presumably in S3, RDS, DynamoDB and so on. Or > use an EBS volume, attached to the EC2 node to provide persistent disk > space (on which your mnesia database can reside). > > * The game is all about risk mitigation. If you regularly take a mnesia > backup and store it into S3, or something like it, you can get speedy > recovery to that point in time should the accident happen. If you want > better point-in-time-recovery, you can try running two mnesia nodes, but > you need to heed two important caveats: > - You probably want your nodes to run in different zones so a failure > in one zone doesn't take down everything. > - Amazons network is brittle and likely to drop connections which are > seen as netsplits. > > * Mnesia mitigates risk by assuming the nodes are fairly robust and stable, > as well as the network between them. If you buy good expensive hardware, > this is a likely assumption and the noise of error will be low. So manual > intervention in the case of an error is probably what is needed anyway (to > fix the faulty hardware as well). > > * Amazon and other leased environments tend to have brittle network > connections and flaky machines. To mitigate this, your system must make no > assumptions about stability and handle this up front. Mnesia wasn't really > built to work in such an environment. > > > > On Sat, Jul 29, 2017 at 10:23 PM wrote: > > > Hello, > > > > Wasabi is a new cloud storage service that promotes lower storage costs > > and greater speed than Amazon S3: > > > > https://wasabi.com/ > > > > During the dev phase I'm running mnesia on the back-end of my current web > > project. I much like the seamless way that mnesia integrates into Erlang > as > > well as its replication feature. But folks have warned about the hassles > of > > mnesia net splits. > > > > Problem is that I have no operations experience to objectively weigh > > options. But I do want to bridge over all points of failure as > > cost-and-time-effectively as possible. > > > > So, my question is if and how I can integrate Wasabi (or Amazon S3 for > > that matter) into my operation to significantly reduce the probability of > > data loss? > > > > > > Many thanks, > > > > LRP > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Mon Jul 31 01:53:13 2017 From: lloyd@REDACTED (lloyd@REDACTED) Date: Sun, 30 Jul 2017 19:53:13 -0400 (EDT) Subject: [erlang-questions] mnesia -- a naive question In-Reply-To: References: <1501359822.197832204@apps.rackspace.com> <1501443194.391423862@apps.rackspace.com> Message-ID: <1501458793.23424569@apps.rackspace.com> Thank you Jesper for your thoughtful and generous insights and advice. I will definitely look at Google's SRE handbook. It would be great to see a definitive book on deployment and maintenance of Erlang systems from beta to full production in the Erlang canon. Thanks again, Lloyd -----Original Message----- From: "Jesper Louis Andersen" Sent: Sunday, July 30, 2017 3:58pm To: lloyd@REDACTED Cc: "Erlang" Subject: Re: [erlang-questions] mnesia -- a naive question I often recommend people to crawl before walk before run before fly before teleport. Mnesia is a fine choice due to the low impedance. Just store Erlang terms and you are up and running. As long as you are trying to validate a product or a solution, it is more important to move fast than it is to worry too much about operational problems. The reason is that your data size is likely to be small and thus it is fairly easy to just restore everything. Once you are more established and have a valid proof-of-concept, you can start looking into a solution that has better durability and resilience. The key aspect is to design your system with this change and extension in mind: if you plan on using something like Riak, which is AP and has no transactions, your current solution shouldn't rely too much on those kinds of things. A Postgresql instance is likely to work fine up to a couple dozen terabytes as well. On the other hand: Mnesia seems to have served Klarna well. And their business is likely to be far larger than yours for the coming years. So perhaps one can scale a Mnesia based system somewhat easily while keeping the system operational. A key observation is that a modern server is so friggin' large we cut them up into small pieces and leased out small pieces as virtual machines: most systems doesn't need a full machine anymore. But it also means that vertical scaling is likely to work up to a point that is far greater than earlier on. As for operations: almost all of Google's SRE handbook is worth studying. In this particular case, you want to have a target availability set before you deploy the system. Are you going for 99.9% uptime over 3 months, or more? Most systems are actually fine around 99% and well-designed Erlang systems are likely to give you more than that in the software, leaving most errors to be hardware faults. At 99% you usually have ample time to recover. On Sun, Jul 30, 2017 at 9:33 PM wrote: > Hi Jesper, > > Your points are reassuring. Thank you. > > Wasabi promotes their site as 6x faster and 1/5th the cost of Amazon S3. > In the spirit of due diligence my next steps are: > > 1. Do upload/recovery tests with large files to see minimal likely time > for recovery > 2. Visit Wasabi to check them out. They're in Boston so easy to do > 3. For dev/testing/very early production I'm thinking of hosting two or > maybe three Erlang Nitrogen + mnesia servers in house > 4. See if I can come up with a script to detect outage and initiate > recovery > 5. This doesn't address replication across Zones, but one step at a time > > I had been considering Riak KV, but this seems easier to implement with > less overhead. > > I still have many questions. But I'm months from actual beta launch, so > this plan at least provides a starting point for critique and refinement. > > Wish me luck. > > All the best, > > Lloyd > > -----Original Message----- > From: "Jesper Louis Andersen" > Sent: Sunday, July 30, 2017 9:13am > To: lloyd@REDACTED, "Erlang" > Subject: Re: [erlang-questions] mnesia -- a naive question > > A couple of points: > > * Mnesia protects you against the scenario where one of your nodes fail. It > doesn't automatically protect you against the network splitting, and > requires some manual recovery on the flip side of such an event. For rather > small clusters, this is manageable by manual operation. Larger systems will > be far harder to maintain because the risk of netsplits and node loss goes > up whenever you add a new node. > > * I don't know about Wasabi, but Amazon's EC2 nodes are ephemeral in the > sense they can go away at a moments notice. And when this happens, the data > on the node is gone. Thus, to achieve persistent storage, you must either > store data off the EC2 node, presumably in S3, RDS, DynamoDB and so on. Or > use an EBS volume, attached to the EC2 node to provide persistent disk > space (on which your mnesia database can reside). > > * The game is all about risk mitigation. If you regularly take a mnesia > backup and store it into S3, or something like it, you can get speedy > recovery to that point in time should the accident happen. If you want > better point-in-time-recovery, you can try running two mnesia nodes, but > you need to heed two important caveats: > - You probably want your nodes to run in different zones so a failure > in one zone doesn't take down everything. > - Amazons network is brittle and likely to drop connections which are > seen as netsplits. > > * Mnesia mitigates risk by assuming the nodes are fairly robust and stable, > as well as the network between them. If you buy good expensive hardware, > this is a likely assumption and the noise of error will be low. So manual > intervention in the case of an error is probably what is needed anyway (to > fix the faulty hardware as well). > > * Amazon and other leased environments tend to have brittle network > connections and flaky machines. To mitigate this, your system must make no > assumptions about stability and handle this up front. Mnesia wasn't really > built to work in such an environment. > > > > On Sat, Jul 29, 2017 at 10:23 PM wrote: > > > Hello, > > > > Wasabi is a new cloud storage service that promotes lower storage costs > > and greater speed than Amazon S3: > > > > https://wasabi.com/ > > > > During the dev phase I'm running mnesia on the back-end of my current web > > project. I much like the seamless way that mnesia integrates into Erlang > as > > well as its replication feature. But folks have warned about the hassles > of > > mnesia net splits. > > > > Problem is that I have no operations experience to objectively weigh > > options. But I do want to bridge over all points of failure as > > cost-and-time-effectively as possible. > > > > So, my question is if and how I can integrate Wasabi (or Amazon S3 for > > that matter) into my operation to significantly reduce the probability of > > data loss? > > > > > > Many thanks, > > > > LRP > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > From ok@REDACTED Mon Jul 31 01:59:04 2017 From: ok@REDACTED (Richard A. O'Keefe) Date: Mon, 31 Jul 2017 11:59:04 +1200 Subject: [erlang-questions] Internal compiler atoms In-Reply-To: References: Message-ID: <936c842a-f087-77f4-6b30-4ff558941181@cs.otago.ac.nz> On 28/07/17 7:33 PM, Albin Stig? wrote: > I find "The BEAM book" to be a great resource when I run in to these > kinds of problems: > https://github.com/happi/theBeamBook I would like to say a public and heartfelt THANK YOU to everyone who has contributed to the BEAM book. From lloyd@REDACTED Mon Jul 31 02:11:39 2017 From: lloyd@REDACTED (lloyd@REDACTED) Date: Sun, 30 Jul 2017 20:11:39 -0400 (EDT) Subject: [erlang-questions] Internal compiler atoms In-Reply-To: <936c842a-f087-77f4-6b30-4ff558941181@cs.otago.ac.nz> References: <936c842a-f087-77f4-6b30-4ff558941181@cs.otago.ac.nz> Message-ID: <1501459899.12921958@apps.rackspace.com> Thanks for the links! Looks like I have several weeks of study ahead of me. All the best, Lloyd -----Original Message----- From: "Richard A. O'Keefe" Sent: Sunday, July 30, 2017 7:59pm To: erlang-questions@REDACTED Subject: Re: [erlang-questions] Internal compiler atoms On 28/07/17 7:33 PM, Albin Stig? wrote: > I find "The BEAM book" to be a great resource when I run in to these > kinds of problems: > https://github.com/happi/theBeamBook I would like to say a public and heartfelt THANK YOU to everyone who has contributed to the BEAM book. _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions From ok@REDACTED Mon Jul 31 02:16:45 2017 From: ok@REDACTED (Richard A. O'Keefe) Date: Mon, 31 Jul 2017 12:16:45 +1200 Subject: [erlang-questions] Internal compiler atoms In-Reply-To: References: Message-ID: On 30/07/17 1:18 AM, Bj?rn-Egil Dahlberg wrote: > All identifiers, i.e. variables and function names, are represented as > atoms internally in the compiler. For what it's worth, Quintus Prolog on 32-bit machines had a hard limit of 2 million atoms and a realistic limit of a lot fewer. With that in mind, Quintus represented variable names as a sort of ersatz packed string (in such a way that they sorted correctly). With some of our customers trying to compile large amounts of machine-generated code, this was a practical necessity. For Erlang, binaries are the obvious choice. From dclarke@REDACTED Mon Jul 31 11:31:22 2017 From: dclarke@REDACTED (Dennis Clarke) Date: Mon, 31 Jul 2017 05:31:22 -0400 Subject: [erlang-questions] compile and install from source? Where is this documented? Message-ID: <4bada3c9-c9f0-5da4-22b6-aed0781b8c03@blastwave.org> Just curious about the process for building from sources. I have been looking around http://erlang.org/doc/search/ and I did find : http://erlang.org/doc/installation_guide/INSTALL.html Excellent. I have otp_src_20.0 and in there I see a "HOWTO" with some docs. Those claim that one must have either gcc or clang as the compiler. Is the code not C99 portable? Can I try to compile it with a strict C99 compiler ? Is there a testsuite to verify the results? I see a link for "Please have a look at the Known platform issues chapter before you start. " but that link goes no where. Is there such a page somewhere ? Thank you for any help I can receive here. dc From mikpelinux@REDACTED Mon Jul 31 14:47:37 2017 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Mon, 31 Jul 2017 14:47:37 +0200 Subject: [erlang-questions] compile and install from source? Where is this documented? In-Reply-To: <4bada3c9-c9f0-5da4-22b6-aed0781b8c03@blastwave.org> References: <4bada3c9-c9f0-5da4-22b6-aed0781b8c03@blastwave.org> Message-ID: <22911.9961.843792.681447@gargle.gargle.HOWL> Dennis Clarke writes: > > Just curious about the process for building from sources. I have been > looking around http://erlang.org/doc/search/ and I did find : > > http://erlang.org/doc/installation_guide/INSTALL.html > > Excellent. I have otp_src_20.0 and in there I see a "HOWTO" with some > docs. Those claim that one must have either gcc or clang as the > compiler. Is the code not C99 portable? Can I try to compile it with a > strict C99 compiler ? It should build with a C99 compiler. If it doesn't, that's a bug needing to be fixed. However, most developers use either gcc or clang, or sometimes MS' almost-but-not-quite C-compiler, so some cases may be broken. > Is there a testsuite to verify the results? Yes. See HOWTO/TESTING.md in the source code. You'll want to run the "emulator" suite to begin with.