Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

ANN: Visual Studio Code extension (ParaSail Language)

50 views
Skip to first unread message

Olivier Henley

unread,
May 10, 2019, 8:21:01 PM5/10/19
to ParaSail Programming Language

Just to let you know that I released a VSCode extension for ParaSail.

*You dont trust me... see for yourself*


*What's in it*

- It only supports syntax highlighting for the moment.

*How*

- Install VSCode. 
- On the left panel, choose the extension icon (Square icon). 
- Search for "ParaSail" in the top search bar.
- Click 'install".
- Open a .psi or .psl file

*Why Visual Studio Code*

- VSCode is open source, modern, lightweight and truly free
- Its more or less as powerful as Visual Studio ... without the legacy stuff; which is great.
- It runs on Windows, Linux and Mac.
- It is truly extensible (intellisense, auto-completion, debugger etc) can be bootstrapped to any language. (Language Server Protocol) 
- The plugin/extension ecosystem is very rich.

*How to help*

- The syntax highlight is 'pretty fine' in this first version but I know it can be tweaked to perfection. Any help is welcome.
- The code is available here: https://github.com/ohenley/parasail-vscode
- Do not hesitate to create a pull request, I review and merge asap. 

Ok, see you around,

olivier

Tucker Taft

unread,
May 11, 2019, 12:13:10 AM5/11/19
to ParaSail Programming Language
Very cool.   Thanks for creating this, and sharing the news about it.

Take care,
-Tuck

--
You received this message because you are subscribed to the Google Groups "ParaSail Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to parasail-programming...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/parasail-programming-language/2a197682-c96a-44f7-8154-7138b0836e6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Olivier Henley

unread,
May 13, 2019, 9:35:22 AM5/13/19
to ParaSail Programming Language
I am puzzled here. I crossed some ParaSail code having a single quote symbol following a word likes such:

Something'

My actual syntax highlighter opens a string at that point... so to fix it I need to know the following:

a) Are ParaSail strings exclusively enclosed by " " (double quote)?  
b) I removed such single quote and the code still compiled... Is it normal or was I fooled by the interpreter? Which section of the RM talks about this syntax?


Thank you,

Olivier

Tucker Taft

unread,
May 13, 2019, 10:48:12 AM5/13/19
to ParaSail Programming Language
On Mon, May 13, 2019 at 9:35 AM Olivier Henley <olivier...@gmail.com> wrote:
I am puzzled here. I crossed some ParaSail code having a single quote symbol following a word likes such:

Something'

My actual syntax highlighter opens a string at that point... so to fix it I need to know the following:

a) Are ParaSail strings exclusively enclosed by " " (double quote)? 

Multi-character string literals use double quotes (e.g. "hello").  A single-character literal uses single quotes  (e.g. 'x').

The single quote immediately after an expression is usable only in a postcondition annotation, and it refers to the updated value of a "var" parameter.  This is described on pages 48-50 of version 8.0 of the ParaSail Reference Manual (the "Annotations" chapter).

So for example, if you want to specify the pre- and postconditions of a Stack "Pop" operation, you could write:

      func Pop(var S : Stack {Count(S) > 0}) -> Component
           {Count(S ’) == Count(S) − 1} is ...

which indicates that, before calling "Pop," Count(S) must be greater than zero (i.e. stack must not be empty), and after calling "Pop," the final value of Count(S) will be one less than the original value of Count(S).

The single quote used in this "postcondition" context is pronounced "prime."  Hence, "the Count of S prime is one less than the Count of the original value of S."  This notation was adopted for two reasons.  One, the notion of "X prime" is common in mathematics to represent the result of a transformation of some sort (e.g. see https://en.wikipedia.org/wiki/Prime_(symbol)#Use_in_mathematics,_statistics,_and_science).  Programming languages have sometimes adopted an alternative notation, where the original value is marked specially (e.g. ~X or X'Old) while the new value is unmarked.  The second reason is the following -- in ParaSail, we wanted preconditions and postconditions to have the same meaning for the same symbols, because they might appear next to one another, so in both, the unmarked variable name refers to the incoming, original value, and in postconditions, the "prime notation" is used to refer to the updated, final value.

This single-quote "prime" notation is only recognized by the lexer when it occurs immediately after an identifier, ')', or ']'.  See parser/parasail_lex.l if you want the details -- look for the "TICK" state, and the "PRIME" token.
 
 
b) I removed such single quote and the code still compiled... Is it normal or was I fooled by the interpreter? Which section of the RM talks about this syntax?

As mentioned above, the "prime" notation is explained in the "Annotations" section.


Thank you,

Olivier

Take care,
-Tuck


--
You received this message because you are subscribed to the Google Groups "ParaSail Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to parasail-programming...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages