Erlang Development Environment: edoc server

39 views
Skip to first unread message

Bach Le

unread,
Mar 11, 2014, 5:11:00 AM3/11/14
to beam-co...@googlegroups.com
Hi,

I am Bach Le from National University of Singapore. I have been programming in Erlang for 1-2 years and it has replaced C++ as my favourite language (serious). Aside from closed projects, I have several open-source Erlang projects which can be found at: https://github.com/bullno1?tab=repositories. I have also contributed to some open source Erlang projects such as locks, cowboy and epgsql.

I do most of my Erlang development using vim and vimerl. One of the problem I frequently face is recalling the precise type of an argument or the fine implications of arguments. I feel that better code completion and documentation browsing is important to help Erlang reach a wider audience and make programmers more productive. Erlang currently has edoc which generates HTML documents, however it has the following limitation:
  • Searching is not good enough
  • No interface for integration into other programs such as text editors
I would like to propose an Erlang application called edoc_server which does the following:
  • It uses the edoc application to generate documents, indexes and store them in a cache
  • It exposes searching, browsing through a HTTP interface using cowboy. Both HTML for human consumption and JSON/XML for machine consumption will be supported.
  • Incremental search is supported
The documents can be accessed in several ways:
  • For learning a new library/browsing for functionalities, an user can start edoc_server in daemon mode and use his web browser to browse the document similar to the current edoc or OTP document system. However, he can quickly search for a module/application/function using an incremental search box similar to erldocs.com
  • When an user is working on his code, he can quickly reference the document with a terminal tool for example, the command: edoc_search gproc:reg/2 will prints the document for gproc:regs/2 with all parameters, results and success types.
  • When an user is debugging/testing his application from the Erlang shell, if edoc_server is in the code path, he can call edoc_search:get_doc from the shell similar to the terminal variant.
  • Finally, for a text editor, it can connect to a running edoc_server through the REST interface to support code completion and documentation hover tooltip. The incremental search interface will help to provide low latency reply.
Currently, I think the most challenging aspect is to implement a fast enough search implementation. However, since the amount of data is very small as compared to memory of a modern computer an average developer uses. I believe it is possible to keep everything in memory and only cache to disk to avoid having to scan through source codes every time edoc_server is started.

José Valim

unread,
Mar 12, 2014, 9:55:36 AM3/12/14
to Bach Le, beam-co...@googlegroups.com
Hello Bach Le,

The idea sounds very interesting however I am not sure how it fits the priorities of the Erlang Solutions team, which is responsible for similar and the Erlang Development proposals. So I would recommend you to submit this proposal but also entertain some of the other projects/ideas in the wiki that you find interesting.

Cheers,



José Valim
Skype: jv.ptec
Founder and Lead Developer

Torben Hoffmann

unread,
Mar 17, 2014, 11:16:12 AM3/17/14
to beam-co...@googlegroups.com
Hi Bach,

We have discussed this internally in ESL and we think it could be a good project, so please submit your proposal on this.

Cheers,
Torben

Bach Le

unread,
Mar 19, 2014, 3:14:30 AM3/19/14
to Torben Hoffmann, beam-co...@googlegroups.com
Hi Torban,

Thanks for the good news. I will start to work on my proposal.

Regards,
Bach
Reply all
Reply to author
Forward
0 new messages