Re: Using Browser as Front End

Haitao Zhang <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <CAFUyvho+odvsWM5wa0NMDLBAqoODH2O3kvC3LDFU8wJDqC2avA@mail.gmail.com>
On Sat, Dec 14, 2013 at 3:21 AM, Jan Wielemaker <[email protected]> wrote:

> Dear Haitao,
>
> You'd almost think it is easier to add WS to SWI-Prolog :-)
>

I hear you :-)  Writing a stand alone WS service for my use case of getting
the browser to accept push data from peer applications is probably not that
hard. I use this one https://github.com/ahyatt/emacs-websocket which is a
fairly straightforward implementation. As I need to access the WS from
emacs for js REPL as well having Emacs or Prolog be the server does not
make much difference to me at this moment. On the other hand, writing a
full blown WS server that would cooperate with the HTTP server and scale
well could be challenging, as it is a connection-oriented service.

Good to see other people also think this is the way to go.  There has
> been some discussion on the list about this.  I suspect it will move
> in that direction.  When and to what level is unclear.  A considerable
> amount of resources is needed to get anywhere near the tools that
> exist now.
>
>         Cheers --- Jan
>

I found your previous discussion here:
http://swi-prolog.996271.n3.nabble.com/QT-Console-tt12572.html#none and it
was a good read. I don't know if you have heard of tern.js (I just learned
about it today off HN). It could be a useful model of providing services to
front end code editors. From http://ternjs.net/:
"Tern is a stand-alone code-analysis engine for JavaScript. It is intended
to be used with a code editor plugin to enhance the editor's support for
intelligent JavaScript editing. Features provided are:
Autocompletion on variables and properties
Function argument hints
Querying the type of an expression
Finding the definition of something
Automatic refactoring"

I understand that SWI already provide many of these features through
PceEmacs but they are not necessarily exposed for external editors.
Personally my project is small enough currently that I am fine with the
limited static analysis support provided in Emacs and am instead heavily
dependent on the REPL. If I really need it I can manually call:
:- pce_dispatch([]), set_prolog_flag(xpce_threaded, true).
and then call edit or even prolog_edit:locate but it is not very
convenient. For bigger projects and code bases I can see the importance of
making similar features available from a Prolog engine to support tighter
integration with external code editors.

Haitao
-------------- next part --------------
HTML attachment scrubbed and removed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.