unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Wisp error location?
@ 2019-02-26 14:29 zimoun
  2019-02-26 22:14 ` Arne Babenhauserheide
  0 siblings, 1 reply; 4+ messages in thread
From: zimoun @ 2019-02-26 14:29 UTC (permalink / raw)
  To: guile-user

Dear,

As you maybe know, the Guix Workflow Language [1] now support the Wisp
notation [2].
And it improves the readibility, IMHO.
Nice!


[1] https://archive.fosdem.org/2017/schedule/event/guixworkflowmanagement/
[2] https://git.savannah.gnu.org/cgit/gwl.git/tree/gwl/utils.scm#n34



However, Wisp v0.9 does not support (yet?) the location when it fails
to compile.
I have not tried the v1.0 because it is not packaged in Guix, yet. :-)

Just to fix the idea:

define : sqr x
       * x x

define add1 x
       1+ x


then `guild compile -f wisp ~/tmp/test.w` fails with:

ice-9/boot-9.scm:752:25: In procedure dispatch-exception:
Syntax error:
unknown location: source expression failed to match any pattern in
form (define add1 x (#{1+}# x))

and it is not always to find where the location is. Compared to the
Lisp notation, the line is pointed:

ice-9/boot-9.scm:752:25: In procedure dispatch-exception:
Syntax error:
/home/simon/tmp/test.scm:5:0: source expression failed to match any
pattern in form (define add1 x (#{1+}# x))


Does it seem fixable ?


Thank you in advance for any comments.

All the best,
simon

ps:
I do not if there is a dedicated mailing list about Wisp or a bug tracker.
Sorry if it is incorrectly addressed and let me know where to post.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Wisp error location?
  2019-02-26 14:29 Wisp error location? zimoun
@ 2019-02-26 22:14 ` Arne Babenhauserheide
  2019-03-02 21:19   ` Arne Babenhauserheide
  0 siblings, 1 reply; 4+ messages in thread
From: Arne Babenhauserheide @ 2019-02-26 22:14 UTC (permalink / raw)
  To: zimoun; +Cc: guile-user

[-- Attachment #1: Type: text/plain, Size: 2642 bytes --]

Dear simon,

Thank you for writing!

The error-reporting in wisp is currently not at the level of regular
Scheme. For some errors you already get the line numbers, but others
still lack them.

The happy case: If you run the following via guile --language=wisp
/tmp/test.w, for example, you get the correct line number of the error:


define : sqr x
       * x x

define : add1 x
       error "foo ~a" 'foo
       1+ x

add1 2


Adding line number information for compile errors will still take some
time — it should be fixable, but I will have to do more reading up on
Guile compiler internals for that, so I cannot promise a fix within the
next months.

However you can use a workaround: in case of an error automatically
transform the file to regular scheme and run the compiler on that
again. The line numbers should then match exactly.

I know that that’s only a workaround, but it should already ease
debugging a lot. I hope it helps you!

guild compile -f wisp /tmp/test.w || (wisp2lisp /tmp/test.w > /tmp/test.scm && guild compile /tmp/test.scm)


Best wishes,
Arne


zimoun <zimon.toutoune@gmail.com> writes:

> Dear,
>
> As you maybe know, the Guix Workflow Language [1] now support the Wisp
> notation [2].
> And it improves the readibility, IMHO.
> Nice!
>
>
> [1] https://archive.fosdem.org/2017/schedule/event/guixworkflowmanagement/
> [2] https://git.savannah.gnu.org/cgit/gwl.git/tree/gwl/utils.scm#n34
>
>
>
> However, Wisp v0.9 does not support (yet?) the location when it fails
> to compile.
> I have not tried the v1.0 because it is not packaged in Guix, yet. :-)
>
> Just to fix the idea:
>
> define : sqr x
>        * x x
>
> define add1 x
>        1+ x
>
>
> then `guild compile -f wisp ~/tmp/test.w` fails with:
>
> ice-9/boot-9.scm:752:25: In procedure dispatch-exception:
> Syntax error:
> unknown location: source expression failed to match any pattern in
> form (define add1 x (#{1+}# x))
>
> and it is not always to find where the location is. Compared to the
> Lisp notation, the line is pointed:
>
> ice-9/boot-9.scm:752:25: In procedure dispatch-exception:
> Syntax error:
> /home/simon/tmp/test.scm:5:0: source expression failed to match any
> pattern in form (define add1 x (#{1+}# x))
>
>
> Does it seem fixable ?
>
>
> Thank you in advance for any comments.
>
> All the best,
> simon
>
> ps:
> I do not if there is a dedicated mailing list about Wisp or a bug tracker.
> Sorry if it is incorrectly addressed and let me know where to post.


--
Unpolitisch sein
heißt politisch sein
ohne es zu merken

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1076 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Wisp error location?
  2019-02-26 22:14 ` Arne Babenhauserheide
@ 2019-03-02 21:19   ` Arne Babenhauserheide
  2019-03-04 11:02     ` zimoun
  0 siblings, 1 reply; 4+ messages in thread
From: Arne Babenhauserheide @ 2019-03-02 21:19 UTC (permalink / raw)
  To: zimoun; +Cc: guile-user

[-- Attachment #1: Type: text/plain, Size: 2902 bytes --]

Hi simon,

Did you get to a workaround that works for you?

Best wishes,
Arne

Arne Babenhauserheide <arne_bab@web.de> writes:

> Dear simon,
>
> Thank you for writing!
>
> The error-reporting in wisp is currently not at the level of regular
> Scheme. For some errors you already get the line numbers, but others
> still lack them.
>
> The happy case: If you run the following via guile --language=wisp
> /tmp/test.w, for example, you get the correct line number of the error:
>
>
> define : sqr x
>        * x x
>
> define : add1 x
>        error "foo ~a" 'foo
>        1+ x
>
> add1 2
>
>
> Adding line number information for compile errors will still take some
> time — it should be fixable, but I will have to do more reading up on
> Guile compiler internals for that, so I cannot promise a fix within the
> next months.
>
> However you can use a workaround: in case of an error automatically
> transform the file to regular scheme and run the compiler on that
> again. The line numbers should then match exactly.
>
> I know that that’s only a workaround, but it should already ease
> debugging a lot. I hope it helps you!
>
> guild compile -f wisp /tmp/test.w || (wisp2lisp /tmp/test.w > /tmp/test.scm && guild compile /tmp/test.scm)
>
>
> Best wishes,
> Arne
>
>
> zimoun <zimon.toutoune@gmail.com> writes:
>
>> Dear,
>>
>> As you maybe know, the Guix Workflow Language [1] now support the Wisp
>> notation [2].
>> And it improves the readibility, IMHO.
>> Nice!
>>
>>
>> [1] https://archive.fosdem.org/2017/schedule/event/guixworkflowmanagement/
>> [2] https://git.savannah.gnu.org/cgit/gwl.git/tree/gwl/utils.scm#n34
>>
>>
>>
>> However, Wisp v0.9 does not support (yet?) the location when it fails
>> to compile.
>> I have not tried the v1.0 because it is not packaged in Guix, yet. :-)
>>
>> Just to fix the idea:
>>
>> define : sqr x
>>        * x x
>>
>> define add1 x
>>        1+ x
>>
>>
>> then `guild compile -f wisp ~/tmp/test.w` fails with:
>>
>> ice-9/boot-9.scm:752:25: In procedure dispatch-exception:
>> Syntax error:
>> unknown location: source expression failed to match any pattern in
>> form (define add1 x (#{1+}# x))
>>
>> and it is not always to find where the location is. Compared to the
>> Lisp notation, the line is pointed:
>>
>> ice-9/boot-9.scm:752:25: In procedure dispatch-exception:
>> Syntax error:
>> /home/simon/tmp/test.scm:5:0: source expression failed to match any
>> pattern in form (define add1 x (#{1+}# x))
>>
>>
>> Does it seem fixable ?
>>
>>
>> Thank you in advance for any comments.
>>
>> All the best,
>> simon
>>
>> ps:
>> I do not if there is a dedicated mailing list about Wisp or a bug tracker.
>> Sorry if it is incorrectly addressed and let me know where to post.


-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1076 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Wisp error location?
  2019-03-02 21:19   ` Arne Babenhauserheide
@ 2019-03-04 11:02     ` zimoun
  0 siblings, 0 replies; 4+ messages in thread
From: zimoun @ 2019-03-04 11:02 UTC (permalink / raw)
  To: Arne Babenhauserheide; +Cc: guile-user

Hi Arne,

I use your solution when debugging:
   wisp2lisp /tmp/test.w > /tmp/test.scm \
       && guild compile /tmp/test.scm

At FOSDEM, when dining with Ludo and Ricardo, we spoke about syntax and so on.
Well, as explained, Ricardo implemented the Wisp support in the Guix
Workflow Language (GWL); which is nice and improves a lot the
readibility of the very workflows.
Ludo spotted on the location issue and he suggested to report it to
you; what I am doing. :-)
Then, I did not where exactly to submit you this "feature request",
and because maybe the Guile community is interested. So here we are.
:-)

Well, I think I get your point:
 1. it is a bit complicated because it needs some divings in the Guile
internals;
 2. it needs some time because it is a piece of work;
 3. you cannot promise a fix.

In the meantime, I will use the `wisp2lisp` trick. :-)


Well, the GWL uses Wisp to describe the processes and workflows. If
you are interested by this use-case, please join the mailing list:
gwl-devel at gnu.org.
Roughly speaking, we are trying to build a "similar" tool than
SnakeMake (Python-based) [1] but on-the-top of Guix and Guile-based.
See you there? ;-)

[1] https://snakemake.readthedocs.io/en/stable/


Thank you for wisp and all your work !!

All the best,
simon



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-04 11:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-26 14:29 Wisp error location? zimoun
2019-02-26 22:14 ` Arne Babenhauserheide
2019-03-02 21:19   ` Arne Babenhauserheide
2019-03-04 11:02     ` zimoun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).