[m-users.] newbe tutorial on development workflow and debugging

emacstheviking objitsu at gmail.com
Tue Jul 2 19:24:21 AEST 2019


Hi Daniel,

I have a feeling that "printf debugging" is still viable!

Like I said, I use Emacs and that mode for editing and it has a shortcu key
to quickly compile the buffer and also run the file if it is self-contained
but I am playing with the foreign function stuff to build a wrapper around
librabbitmq so I have to build it from the command line but it's no big
deal.

I believe there *is* a mercury debugger as I have seen reference to things
here and there, I can only refer you to chapter 7 in the manual: (I've not
used the emacs interface to it)

https://www.mercurylang.org/information/doc-latest/mercury_user_guide/Debugging.html#Debugging

As a Mercury n00b myself but with several years of intermittent Prolog
experience, the switch to Mercury is very interesting in that it makes you
more aware of the deerminism and modes of your predicates. And a function
is a predicate, remember that!

Hope that helps a bit.


Sean.







On Tue, 2 Jul 2019 at 09:53, Daniel Gross <grossd18 at gmail.com> wrote:

> Hi Sean,
>
> Thanks.
>
> So, how do you debug your code ... by adding inline writes ...
>
> I see step by step tracing of a program / debugging as part of the
> learning opportunity during problem solving.
>
> Would emacs be the only way to get a good debugging view -- i understand
> that there also exists an eclipse plugin -- but it looks dated.
>
> thanks,
>
> Daniel
>
> On Tue, Jul 2, 2019 at 11:46 AM emacstheviking <objitsu at gmail.com> wrote:
>
>> Hi Daniel,
>>
>> O too am learning Mercury from using Prolog since 2012...and to be
>> honest, I use to things daily. Mostly I use Emacs and metal-mercury-mode
>> but if that sounds a bit daunting I can also highly recommened using
>> Microsofts VSCode (not visual studio). It has a mercury plugin that does
>> syntax highlighting and that's all but that's enough.
>>
>> https://github.com/ahungry/metal-mercury-mode
>>
>> https://marketplace.visualstudio.com/items?itemName=brendanzab.mercury
>>
>> I am not sure about the debugging aspect as I have not had cause to use
>> one yet.
>>
>> All thebest,
>> Sean.
>>
>>
>> On Tue, 2 Jul 2019 at 09:21, Daniel Gross <grossd18 at gmail.com> wrote:
>>
>>> Hello,
>>>
>>> I am new to Mercury and have done some development work in Prolog. I and
>>> am very interested in trying this out -- possibly, as an alternative to C /
>>> C++ coding (i.e. to generate high level C code).
>>>
>>> Is there a tutorial that shows how to set up a development environment
>>> and how best to work -- i like interactive work approaches (IDEs) with
>>> visual debuggers -- is this possible to do as well?
>>>
>>> thanks,
>>>
>>> Daniel
>>>
>>> _______________________________________________
>>> users mailing list
>>> users at lists.mercurylang.org
>>> https://lists.mercurylang.org/listinfo/users
>>>
>>
>
> --
>
> --
> Dr. Daniel Grosshttp://www.linkedin.com/in/grossd18
>
> “Predicting rain doesn’t count. Building arks does.” — Warren Buffett
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20190702/41165cc3/attachment-0001.html>


More information about the users mailing list