Anyone has experience to set up Eclipse for Scheme?

68 views
Skip to first unread message

Shujing Ke

unread,
Feb 27, 2018, 3:38:58 PM2/27/18
to opencog
Hi, 

Anyone use Eclipse for Scheme? 
I installed the Scheme plug-in for Eclipse from http://s48.org/sdt/ .
And set the interpreter as 'guile'. Guile is able to launch in Eclipse. But it doesn't really preload the .guile so that it doesn't recognize any Atomese syntax.
It recognize standard Scheme syntax like "let" "define", but it doesn't recognize " use-modules".

There is very little information I can find online. Anyone has the experience to set this up?

Thanks,
Shujing 

Linas Vepstas

unread,
Feb 27, 2018, 5:44:44 PM2/27/18
to opencog
scheme48 is not the same as guile. Both are schemes, but are different
implementations.

Scheme has more than 50 "popular" implementations, and even more
obscure ones. As a language, it is so simple and basic, that a typical
homework assignment for college CS students is "write a
compiler/interpreter for scheme in scheme" (chapter 5 or 6 of SICP
shows exactly how) and so students do this, and better ones get
shared, and eventually morph into bona-fide projects. In fact, its
almost a kind-of competition: see who can create the fastest, best,
most powerful version of scheme -- there's even a website that
documents results for the top 50 schemes on a few hundred different
benchmarks.

Chicken Scheme, PLT, Racket and MzScheme kind-of lead the pack, as a
general rule. However, due to the nature of the scheme-to-c++
bindings, they are not compatible with guile.

--linas
> --
> You received this message because you are subscribed to the Google Groups
> "opencog" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to opencog+u...@googlegroups.com.
> To post to this group, send email to ope...@googlegroups.com.
> Visit this group at https://groups.google.com/group/opencog.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/opencog/CALpD4-KbEDMzrZn-H34C4JChJN6kT1NpEPVdC_nFJz09nBhrww%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



--
cassette tapes - analog TV - film cameras - you

Shujing Ke

unread,
Feb 28, 2018, 10:54:57 AM2/28/18
to opencog
Thanks Linas,

I tried Racket as well but couldn't get it to work with Atomese. Guess it is the same problem as you explained.
Is there anything you know that works with guile and has an convenient debugger?

Shujing 


> To post to this group, send email to ope...@googlegroups.com.
> Visit this group at https://groups.google.com/group/opencog.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/opencog/CALpD4-KbEDMzrZn-H34C4JChJN6kT1NpEPVdC_nFJz09nBhrww%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



--
cassette tapes - analog TV - film cameras - you

--
You received this message because you are subscribed to the Google Groups "opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opencog+unsubscribe@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.
Visit this group at https://groups.google.com/group/opencog.

Cassio Pennachin

unread,
Feb 28, 2018, 11:33:19 AM2/28/18
to opencog
Emacs with Geiser?


For more options, visit https://groups.google.com/d/optout.



--
Cassio Pennachin

Amirouche Boubekki

unread,
Feb 28, 2018, 2:39:49 PM2/28/18
to opencog


On Wednesday, February 28, 2018 at 4:54:57 PM UTC+1, shujingke wrote:

Is there anything you know that works with guile and has an convenient debugger?

FWIW, I use pk aka. peek stuff to debug, it takes a variable list of argument and return the last.

For instance:

(define my-variable 101)
(define out (pk 'my-variable my-variable))
(pk (eq? out 101))

will do print

;; (my-variable 101)
;; (#t)


AFAIK, there is not step debugger in Guile like gdb where you can inspect values at runtime etc...
except if you do live coding and embed an REPL in you app, but I am not sure this is supported by opencog...

HTH

Linas Vepstas

unread,
Feb 28, 2018, 3:02:13 PM2/28/18
to opencog


On Wed, Feb 28, 2018 at 1:39 PM, Amirouche Boubekki <amirouche...@gmail.com> wrote:

> AFAIK, there is not step debugger in Guile like gdb where you can inspect
> values at runtime etc...
> except if you do live coding and embed an REPL in you app, but I am not sure
> this is supported by opencog...

So: First, the default mode for opencog is to run the guile REPL and load opencog as a module.  You can even start the cogserver that way.  So whatever the guile repl offers, its available for opencog.

To debug the C++ code, you can start guile in gdb, then load the opencog modules. Nil has a bunch of gdb macros set up to print assorted C++ objects.

How hard is it to write an ecplise module? If eclipse already has modules for racket, sch48, why not just make a copy of one or the other, and then edit it, and change racket into guile?  Then you'd have a guile module for eclipse, right?

--linas

Shujing Ke

unread,
Feb 28, 2018, 6:21:24 PM2/28/18
to opencog
Thanks.

If there is no any real time debugger for scheme with inspector, then I would just try to use spacemacs as Nil recommended. 

I debug c++ code with qt creator by attaching to debugger to process.

Shujing 

--
You received this message because you are subscribed to the Google Groups "opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opencog+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at https://groups.google.com/group/opencog.

Nil Geisweiller

unread,
Mar 1, 2018, 1:19:13 AM3/1/18
to ope...@googlegroups.com, Shujing Ke
I've just realized an open source branch of Visual Studio exists,
VSCode. I've tried it, it's surprisingly good, it's lean, not tones of
junk getting in your way (unlike the old versions of VS I remember). I
was able to install some scheme extension and it got my scheme files
highlighted. I don't how far it can go, but I feel this has definitely
potential.

Nil

On 03/01/2018 01:21 AM, Shujing Ke wrote:
> Thanks.
>
> If there is no any real time debugger for scheme with inspector, then I
> would just try to use spacemacs as Nil recommended.
>
> I debug c++ code with qt creator by attaching to debugger to process.
>
> Shujing
>
> On Wed, Feb 28, 2018 at 9:01 PM, Linas Vepstas <linasv...@gmail.com
> <mailto:linasv...@gmail.com>> wrote:
>
>
>
> On Wed, Feb 28, 2018 at 1:39 PM, Amirouche Boubekki
> <amirouche...@gmail.com <mailto:amirouche...@gmail.com>>
> wrote:
>
> > AFAIK, there is not step debugger in Guile like gdb where you can inspect
> > values at runtime etc...
> > except if you do live coding and embed an REPL in you app, but I am not sure
> > this is supported by opencog...
>
> So: First, the default mode for opencog is to run the guile REPL and
> load opencog as a module.  You can even start the cogserver that
> way.  So whatever the guile repl offers, its available for opencog.
>
> To debug the C++ code, you can start guile in gdb, then load the
> opencog modules. Nil has a bunch of gdb macros set up to print
> assorted C++ objects.
>
> How hard is it to write an ecplise module? If eclipse already has
> modules for racket, sch48, why not just make a copy of one or the
> other, and then edit it, and change racket into guile?  Then you'd
> have a guile module for eclipse, right?
>
> --linas
>
>
> --
> cassette tapes - analog TV - film cameras - you
>
> --
> You received this message because you are subscribed to the Google
> Groups "opencog" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to opencog+u...@googlegroups.com
> <mailto:opencog+u...@googlegroups.com>.
> To post to this group, send email to ope...@googlegroups.com
> <mailto:ope...@googlegroups.com>.
> <https://groups.google.com/group/opencog>.
> <https://groups.google.com/d/msgid/opencog/CAHrUA379gBZu6ss19Er_6%2BRCbG8gaizA0%3Dj8BMGaLdEuzjJMQA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "opencog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to opencog+u...@googlegroups.com
> <mailto:opencog+u...@googlegroups.com>.
> To post to this group, send email to ope...@googlegroups.com
> <mailto:ope...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/opencog.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/opencog/CALpD4-Kh5u2zZWAMAy8xZUTksqK9N83sUMe2mtzNRcz0j3LdKg%40mail.gmail.com
> <https://groups.google.com/d/msgid/opencog/CALpD4-Kh5u2zZWAMAy8xZUTksqK9N83sUMe2mtzNRcz0j3LdKg%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Nil Geisweiller

unread,
Mar 1, 2018, 2:47:53 AM3/1/18
to ope...@googlegroups.com, Shujing Ke
I've just tried Spacemacs, and as awesome as it looks it's still hard to
approach, I can see that if I were not familiar with Emacs I would be
utterly lost. The online help is pretty good though, but it does require
to take the time to go through it, while VSCode is intuitive at first use.

I still suspect Emacs is superior to VSCode (good luck trying to run
VSCode on a headless server + a zillion other things I'm sure), but for
newbies the ready-to-go nature of VSCode is pretty tempting.

Nil

Shujing Ke

unread,
Mar 2, 2018, 6:42:27 AM3/2/18
to Nil Geisweiller, opencog
Awesome! I installed VSCode and immediately like it! 
Which Scheme extension did you install? Is it this one:

Thanks,
Shujing



On Thu, Mar 1, 2018 at 8:47 AM, Nil Geisweiller <ngei...@googlemail.com> wrote:
I've just tried Spacemacs, and as awesome as it looks it's still hard to approach, I can see that if I were not familiar with Emacs I would be utterly lost. The online help is pretty good though, but it does require to take the time to go through it, while VSCode is intuitive at first use.

I still suspect Emacs is superior to VSCode (good luck trying to run VSCode on a headless server + a zillion other things I'm sure), but for newbies the ready-to-go nature of VSCode is pretty tempting.

Nil


On 03/01/2018 08:19 AM, Nil Geisweiller wrote:
I've just realized an open source branch of Visual Studio exists, VSCode. I've tried it, it's surprisingly good, it's lean, not tones of junk getting in your way (unlike the old versions of VS I remember). I was able to install some scheme extension and it got my scheme files highlighted. I don't how far it can go, but I feel this has definitely potential.

Nil

On 03/01/2018 01:21 AM, Shujing Ke wrote:
Thanks.

If there is no any real time debugger for scheme with inspector, then I would just try to use spacemacs as Nil recommended.

I debug c++ code with qt creator by attaching to debugger to process.

Shujing

On Wed, Feb 28, 2018 at 9:01 PM, Linas Vepstas <linasv...@gmail.com <mailto:linasv...@gmail.com>> wrote:



    On Wed, Feb 28, 2018 at 1:39 PM, Amirouche Boubekki

    wrote:

    > AFAIK, there is not step debugger in Guile like gdb where you can inspect
    > values at runtime etc...
    > except if you do live coding and embed an REPL in you app, but I am not sure
    > this is supported by opencog...

    So: First, the default mode for opencog is to run the guile REPL and
    load opencog as a module.  You can even start the cogserver that
    way.  So whatever the guile repl offers, its available for opencog.

    To debug the C++ code, you can start guile in gdb, then load the
    opencog modules. Nil has a bunch of gdb macros set up to print
    assorted C++ objects.

    How hard is it to write an ecplise module? If eclipse already has
    modules for racket, sch48, why not just make a copy of one or the
    other, and then edit it, and change racket into guile?  Then you'd
    have a guile module for eclipse, right?

    --linas


    --     cassette tapes - analog TV - film cameras - you

    --     You received this message because you are subscribed to the Google
    Groups "opencog" group.
    To unsubscribe from this group and stop receiving emails from it,

    To post to this group, send email to ope...@googlegroups.com
    <mailto:opencog@googlegroups.com>.
To unsubscribe from this group and stop receiving emails from it, send an email to opencog+unsubscribe@googlegroups.com <mailto:opencog+unsubscribe@googlegroups.com>.
To post to this group, send email to ope...@googlegroups.com <mailto:opencog@googlegroups.com>.

Nil Geisweiller

unread,
Mar 2, 2018, 3:16:44 PM3/2/18
to Shujing Ke, Nil Geisweiller, opencog
On 03/02/2018 01:42 PM, Shujing Ke wrote:
> Awesome! I installed VSCode and immediately like it!
> Which Scheme extension did you install? Is it this one:
> https://marketplace.visualstudio.com/items?itemName=sjhuangx.vscode-scheme

Yes, that's the one I tried. It doesn't seem to provide much more than
syntax highlighting but I guess that's OK for starter.

Anyway, it takes time to even realize that you need a powerful editor
like Emacs. I remember for the first 10 years of my programming life I
mostly used very rudimentary editors like notepad. Once on Linux I
started using Emacs like another notepad. For a whole 5 years I didn't
tap into its giant potential! Then patterns started to surface, and I
thought more and more "I which my editor could do that". At some point I
even switched to an inferior editor to supposedly empower myself. It's
pathetic but I didn't know what Emacs could do. Then after more research
I realized that this ugly looking editor I had been using for years
could do ALL that I wished. It was a revelation, I spent hundreds of
hours discovering Emacs to its finest abilities over the following
months. I was completely obsessed, and my emacs config file grew from
zero to 4K lines. I had become an emacstheist, an emacstremist, a
devoted apostle of the church of Emacs.

Nil
> <mailto:linasv...@gmail.com
> <mailto:linasv...@gmail.com>>> wrote:
>
>
>
>     On Wed, Feb 28, 2018 at 1:39 PM, Amirouche Boubekki
>     <amirouche...@gmail.com
> <mailto:amirouche...@gmail.com>
> <mailto:amirouche...@gmail.com
> <mailto:amirouche...@gmail.com>>>
>     send an email to opencog+u...@googlegroups.com
> <mailto:opencog%2Bunsu...@googlegroups.com>
>     <mailto:opencog+u...@googlegroups.com
> <mailto:opencog%2Bunsu...@googlegroups.com>>.
>     To post to this group, send email to
> ope...@googlegroups.com <mailto:ope...@googlegroups.com>
>     <mailto:ope...@googlegroups.com
> <mailto:ope...@googlegroups.com>>.
> <https://groups.google.com/d/msgid/opencog/CAHrUA379gBZu6ss19Er_6%2BRCbG8gaizA0%3Dj8BMGaLdEuzjJMQA%40mail.gmail.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/opencog/CAHrUA379gBZu6ss19Er_6%2BRCbG8gaizA0%3Dj8BMGaLdEuzjJMQA%40mail.gmail.com?utm_medium=email&utm_source=footer>>.
>
>
>     For more options, visit
> https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>
>     <https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>>.
>
>
> --
> You received this message because you are subscribed to the
> Google Groups "opencog" group.
> To unsubscribe from this group and stop receiving emails
> from it, send an email to
> opencog+u...@googlegroups.com
> <mailto:opencog%2Bunsu...@googlegroups.com>
> <mailto:opencog+u...@googlegroups.com
> <mailto:opencog%2Bunsu...@googlegroups.com>>.
> To post to this group, send email to
> ope...@googlegroups.com <mailto:ope...@googlegroups.com>
> <mailto:ope...@googlegroups.com
> <mailto:ope...@googlegroups.com>>.
> Visit this group at https://groups.google.com/group/opencog
> <https://groups.google.com/group/opencog>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/opencog/CALpD4-Kh5u2zZWAMAy8xZUTksqK9N83sUMe2mtzNRcz0j3LdKg%40mail.gmail.com
> <https://groups.google.com/d/msgid/opencog/CALpD4-Kh5u2zZWAMAy8xZUTksqK9N83sUMe2mtzNRcz0j3LdKg%40mail.gmail.com>
> <https://groups.google.com/d/msgid/opencog/CALpD4-Kh5u2zZWAMAy8xZUTksqK9N83sUMe2mtzNRcz0j3LdKg%40mail.gmail.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/optout>.
>
>

Shujing Ke

unread,
Mar 3, 2018, 12:14:43 PM3/3/18
to Nil Geisweiller, opencog
Hi Nil, 

Have you got the debugger work in VScode? I tried to debug URE C++ code with it but it doesn't work for me yet. 
The same way works in QT creator that when I launch guile in command line then I can attach the guile process to Qt debugger and the break points I places inside URE code are able to be triggered when I run fc or bc from command line. But when I tried to do the same thing in VSCode, it always couldn't attach to the process and complains that "attach: program path 'enter program name, for example /home/rainkekeke/atomspace/a.out' does not exist". 

I think if it doesn't even work well with c++, then it probably can't do much in debugging scheme...

Shujing

            <mailto:amirouche.boubekki@gmail.com>
            <mailto:amirouche.boubekki@gmail.com

            <mailto:amirouche.boubekki@gmail.com>>>
                 send an email to opencog+unsubscribe@googlegroups.com
            <mailto:opencog%2Bunsubscribe@googlegroups.com>
                 <mailto:opencog+unsubscribe@googlegroups.com
            <mailto:opencog%2Bunsubscribe@googlegroups.com>>.

                 To post to this group, send email to
            ope...@googlegroups.com <mailto:opencog@googlegroups.com>
                 <mailto:opencog@googlegroups.com
            <mailto:opencog@googlegroups.com>>.

            <https://groups.google.com/d/msgid/opencog/CAHrUA379gBZu6ss19Er_6%2BRCbG8gaizA0%3Dj8BMGaLdEuzjJMQA%40mail.gmail.com?utm_medium=email&utm_source=footer>>.


                 For more options, visit
            https://groups.google.com/d/optout
            <https://groups.google.com/d/optout>
                 <https://groups.google.com/d/optout
            <https://groups.google.com/d/optout>>.


            --             You received this message because you are subscribed to the
            Google Groups "opencog" group.
            To unsubscribe from this group and stop receiving emails
            from it, send an email to
            opencog+unsubscribe@googlegroups.com
            <mailto:opencog%2Bunsubscribe@googlegroups.com>
            <mailto:opencog+unsubscribe@googlegroups.com
            <mailto:opencog%2Bunsubscribe@googlegroups.com>>.

            To post to this group, send email to
            ope...@googlegroups.com <mailto:opencog@googlegroups.com>
            <mailto:opencog@googlegroups.com
            <mailto:opencog@googlegroups.com>>.

            Visit this group at https://groups.google.com/group/opencog
            <https://groups.google.com/group/opencog>.
            To view this discussion on the web visit

Nil Geisweiller

unread,
Mar 5, 2018, 7:01:46 PM3/5/18
to Shujing Ke, Nil Geisweiller, opencog
Hi Shujing,

On 03/03/2018 07:14 PM, Shujing Ke wrote:
> or bc from command line. But when I tried to do the same thing in
> VSCode, it always couldn't attach to the process and complains that
> "attach: program path 'enter program name, for example
> /home/rainkekeke/atomspace/a.out' does not exist".

After clicking on the little bug icon, click on the cogwheel, it will
open a launch.json file you need to configure, put the executable you
which to debug in the target (guile for instance), then press the play
button it should work.

In Emacs, one would call the debugger with M-x compile <return> gdb.

>
> I think if it doesn't even work well with c++, then it probably can't do
> much in debugging scheme...

I don't know about debugging scheme in VSCode. For Emacs, as Cassio has
suggested, Geiser seems quite good (I haven't tried it yet).

I would suggest though that, before using a front-end for gdb or guile,
you familiarize yourself with their terminal interface, just to get an
idea of how these tools operate.

Nil
> <mailto:ngei...@googlemail.com
> <mailto:amirouche...@gmail.com>
>             <mailto:amirouche...@gmail.com
> <mailto:amirouche...@gmail.com>>
>             <mailto:amirouche...@gmail.com
> <mailto:amirouche...@gmail.com>
>
>             <mailto:amirouche...@gmail.com
> <mailto:amirouche...@gmail.com>>>>
> opencog+u...@googlegroups.com
> <mailto:opencog%2Bunsu...@googlegroups.com>
>             <mailto:opencog%2Bunsu...@googlegroups.com
> <mailto:opencog%252Buns...@googlegroups.com>>
>                  <mailto:opencog+u...@googlegroups.com
> <mailto:opencog%2Bunsu...@googlegroups.com>
>             <mailto:opencog%2Bunsu...@googlegroups.com
> <mailto:opencog%252Buns...@googlegroups.com>>>.
>                  To post to this group, send email to
> ope...@googlegroups.com <mailto:ope...@googlegroups.com>
> <mailto:ope...@googlegroups.com <mailto:ope...@googlegroups.com>>
>                  <mailto:ope...@googlegroups.com
> <mailto:ope...@googlegroups.com>
>             <mailto:ope...@googlegroups.com
> <mailto:ope...@googlegroups.com>>>.
> opencog+u...@googlegroups.com
> <mailto:opencog%2Bunsu...@googlegroups.com>
>             <mailto:opencog%2Bunsu...@googlegroups.com
> <mailto:opencog%252Buns...@googlegroups.com>>
>             <mailto:opencog+u...@googlegroups.com
> <mailto:opencog%2Bunsu...@googlegroups.com>
>             <mailto:opencog%2Bunsu...@googlegroups.com
> <mailto:opencog%252Buns...@googlegroups.com>>>.
>             To post to this group, send email to
> ope...@googlegroups.com <mailto:ope...@googlegroups.com>
> <mailto:ope...@googlegroups.com <mailto:ope...@googlegroups.com>>
>             <mailto:ope...@googlegroups.com
> <mailto:ope...@googlegroups.com>
>             <mailto:ope...@googlegroups.com
> <mailto:ope...@googlegroups.com>>>.
>             Visit this group at
> https://groups.google.com/group/opencog
> <https://groups.google.com/group/opencog>
>             <https://groups.google.com/group/opencog
> <https://groups.google.com/group/opencog>>.
>             To view this discussion on the web visit
> https://groups.google.com/d/msgid/opencog/CALpD4-Kh5u2zZWAMAy8xZUTksqK9N83sUMe2mtzNRcz0j3LdKg%40mail.gmail.com
Reply all
Reply to author
Forward
0 new messages