Fred Hebert | 9 Feb 04:24
Picon
Gravatar

Shell History to Erlang

Hi there,

I have made a hack named erlang-history available a few months ago and since then I've kept maintaining it in a public repo on github (https://github.com/ferd/erlang-history).

It's basically just a small modification to kernel/group.erl and a new module called group_history.erl. I've used DETS tables at this point in time, as it was (at first) easy to store stuff that way. The old requests are injected into the shell when it first starts up (and it does so for all instances of the shell on a given node). They're saved to disk when the command stack/zipper gets saved after a new line.

The other reason for using DETS, aside for not reinventing stuff, is that it's part of stdlib, which is always there anyway. The only downside is that repairing DETS tables uses the group leader and when the group.erl group leader calls it, it can get stuck in a loop -- that's accounted for in the code.

Anyway, it also supports a full set of options, added to 'kernel': number of lines saved, where to save them, terms to drop from history, etc. They're described in the README of the repository.

To make a long story short, I'm wondering if this kind of material has any chance of making it into OTP proper, rather than just being a hack/patch to apply after installing Erlang.

I know there are no tests, but then, group.erl also has no tests and it's difficult to test it all (which I figure could make the OTP team reluctant to including it). I could add tests for the group_history.erl module itself if required though, but some features would definitely be hard to properly test (such as the group leader stuff above).

Regards,
Fred Hebert.


_______________________________________________
erlang-patches mailing list
erlang-patches <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-patches
Picon
Gravatar

Fix typo in supervisor behaviour doc

Remove unnecessary &gt; from a CDATA section.

Please fetch:
git fetch git://github.com/jimenezrick/otp.git fix-sup-doc-typo

Review here:
https://github.com/jimenezrick/otp/compare/erlang:maint...jimenezrick:fix-sup-doc-typo
https://github.com/jimenezrick/otp/compare/erlang:maint...jimenezrick:fix-sup-doc-typo.patch

Regards
--

-- 
Ricardo (http://r.untroubled.be/)
_______________________________________________
erlang-patches mailing list
erlang-patches <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-patches

Richard Carlsson | 5 Feb 22:15
Picon
Gravatar

add compiler checked atoms

Sorry, pressed send too soon in the last attempt. Here is the code:

   git fetch git <at> github.com:richcarl/otp.git warn-unknown-atom

Here is a suggested patch to the compiler, that I'm throwing out there 
as a request for comments. In any large code base, it can be hard to 
maintain atom hygiene - you may have hidden errors due to misspelled 
atoms, people may be adding atoms without much thought, and it can be 
hard to track which atoms are being used where and for what (e.g., atoms 
used for options, error indicators, message tags, callback module and 
function names, etc. This allows you to declare your atoms like so:

   -atoms([foo, bar]).

You can have any number of such declarations, and an atom may occur 
multiple times and/or in different declarations - it's the union of 
known atoms that matters. Note that this declaration is backwards 
compatible; the current compiler will accept it as a generic attribute 
with no particular meaning.

If you specify the compiler option `warn_unused_atom' when compiling a 
module (you can put `-compile([warn_unused_atom]).' in the module if you 
want to enable the checking in that module only), you will get a warning 
for each atom that has not been explicitly declared. The compiler knows 
about standard atoms such as `ok', `true', `false', `undefined' etc., 
and it does not check function and module names in calls, or record 
names and fields of records, since these are checked in other ways already.

I don't think this addition warrants an EEP, since it doesn't change the 
language as such; it only adds a backwards compatible feature to the 
compiler. However, I'd like to get some initial feedback before I bother 
to update the documentation and submit it as a full patch.

git <at> github.com:richcarl/otp.git

    /Richard
_______________________________________________
erlang-patches mailing list
erlang-patches <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-patches

Picon
Gravatar

Fix the type spec from the doc of binary:part/3

As the doc explains, the Len of part() can be negative.

Please fetch:
git fetch git://github.com/jimenezrick/otp.git fix-binary-doc-spec

Review here:
https://github.com/jimenezrick/otp/compare/erlang:maint...jimenezrick:fix-binary-doc-spec
https://github.com/jimenezrick/otp/compare/erlang:maint...jimenezrick:fix-binary-doc-spec.patch

Regards
--

-- 
Ricardo (http://r.untroubled.be/)
_______________________________________________
erlang-patches mailing list
erlang-patches <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-patches

Picon
Gravatar

Fix typo in `compile' doc: unmatched parenthesis

Please fetch:
git fetch git://github.com/jimenezrick/otp.git fix-compile-doc-typo

Review here:
https://github.com/jimenezrick/otp/compare/erlang:maint...jimenezrick:fix-compile-doc-typo
https://github.com/jimenezrick/otp/compare/erlang:maint...jimenezrick:fix-compile-doc-typo.patch

By the way, could be also possible to add this another patch that I
already sent to erlang-patches?

Set `font-family: Courier, monospace' in OTP doc CSS

This should be much better for everybody, I left Courier as the primary
original font and also added monospace as secondary for people like me
which in Linux haven't it installed.

It should be more pleasant to read typespecs and code examples. Also
adds minor cosmetic changes to the CSS.

Please fetch:
git fetch git://github.com/jimenezrick/otp.git doc-monospace-css

Review here:
https://github.com/jimenezrick/otp/compare/erlang:maint...jimenezrick:doc-monospace-css
https://github.com/jimenezrick/otp/compare/erlang:maint...jimenezrick:doc-monospace-css.patch

Regards
--

-- 
Ricardo (http://r.untroubled.be/)
_______________________________________________
erlang-patches mailing list
erlang-patches <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-patches

Picon
Gravatar

Fix port leaking after controlling_process(Port, self())

I spotted the same issue that Max Lapshin reported in:

http://erlang.org/pipermail/erlang-questions/2011-April/057944.html

Add case to handle the situation when someone call
{gen_tcp,gen_udp}:controlling_process(Port, self()). Also improve spec
and doc from gen_udp and gen_sctp for controlling_process/2.

To reproduce the issue, open an UDP port:

4> {ok,Port} = gen_udp:open(9000, [binary]).
{ok,#Port<0.587>}
5> gen_udp:controlling_process(Port, self()).
ok

Simulate error:

6> 1=2.
** exception error: no match of right hand side value 2

Here is the leak:

7> inet:i().
Port Module   Recv Sent Owner    Local Address Foreign Address State
Type
581  inet_udp 0    0    <0.31.0> *:cslistener  *:*             BOUND
DGRAM
ok

Please fetch:
git fetch git://github.com/jimenezrick/otp.git fix-gen_udp_tcp-leak

Review here:
https://github.com/jimenezrick/otp/compare/erlang:maint...jimenezrick:fix-gen_udp_tcp-leak
https://github.com/jimenezrick/otp/compare/erlang:maint...jimenezrick:fix-gen_udp_tcp-leak.patch

Regards
--

-- 
Ricardo (http://r.untroubled.be/)
_______________________________________________
erlang-patches mailing list
erlang-patches <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-patches

Paul Guyot | 29 Jan 16:25
Gravatar

SSL distribution proxy processes must exit when sockets close

Hello,

There is a bug in SSL distribution : the proxy processes do not exit if the sockets close during the setup.
Since SSL distribution connections can be very slow to setup, this situation happens to be quite common on
a production cluster and can yield to thousands of processes with close messages in their queue.

The following patch, based on maint branch, fixes this bug by simply exiting when a close message is
received during setup.

https://github.com/pguyot/otp/compare/fix-ssl_tls_dist_proxy-setup-loop
git fetch git://github.com/pguyot/otp.git fix-ssl_tls_dist_proxy-setup-loop

Paul
--

-- 
Semiocast            http://semiocast.com/
+33.183627948 - 20 rue Lacaze, 75014 Paris

_______________________________________________
erlang-patches mailing list
erlang-patches <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-patches

Peti Gömöri | 22 Jan 12:36
Picon
Gravatar

observer tv fixes

Hi,

finally a table visualizer in wx.
unfortunately it crashed pretty easily when I tried to click here and there.
Here are some tiny improvement proposals to fix some of the issues:
- when canceling in Edit Object window 'cancel' atom is expected to be returned
- when parsing edited object according to erl_parse docs "token list
must end with the dot token"; ensure this is always true
- handle parse errors in edited objects
- handle invalid regexp in search
- MEssageDialog error terms even if they are not strings
- show printable strings in objects instead of integer lists (like old
tv did) (ugly: 9999 terminal width)

thanks
Peter
Attachment (observer_lib.erl.patch): application/octet-stream, 935 bytes
Attachment (observer_tv_table.erl.patch): application/octet-stream, 1556 bytes
_______________________________________________
erlang-patches mailing list
erlang-patches <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-patches
José Valim | 20 Jan 13:33
Picon
Gravatar

Update module attributes page

The page on module attributes does not mention on_load and callback attributes:



Should I submit a patch to update those or they are not mentioned there on purpose? 

José Valim
Founder and Lead Developer

_______________________________________________
erlang-patches mailing list
erlang-patches <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-patches
José Valim | 20 Jan 10:14
Picon
Gravatar

Support ** for recursion in filelib:wildcard

Some programming languages/softwares (Bash, RACF, Ruby, ...) support "**" for automatic directory recursion when doing a glob. A very convenient use of this feature is to get all files recursively with a given extension:


    filelib:wildcard("src/**/*.erl").

Notice we don't need to loop recursively and it also requires fewer filesystem lookups. I am aware filelib:fold_files allows recursion, but I consider filelib:wildcard simpler to use.

My proposal is to extend filelib:wildcard to support "**". I can provide a patch with docs if you agree to have this feature merged in.


José Valim
Founder and Lead Developer

_______________________________________________
erlang-patches mailing list
erlang-patches <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-patches
Richard Carlsson | 17 Jan 16:36
Picon
Gravatar

update to mnesia-lock-conflict-events

We realized that report_info was a better choice than report_warning for 
this patch. Please refetch:

git fetch git://github.com/richcarl/otp.git mnesia-lock-conflict-events

    /Richard
_______________________________________________
erlang-patches mailing list
erlang-patches <at> erlang.org
http://erlang.org/mailman/listinfo/erlang-patches


Gmane