Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Problems using Jazz
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
William  
View profile  
 More options Mar 15, 1:48 pm
From: William <w7c...@gmail.com>
Date: Sun, 15 Mar 2009 10:48:00 -0700 (PDT)
Subject: Problems using Jazz
I keep trying and keep failing at some basic tasks.
I have a bunch of gambit code that I would like to run/debug
with jazz, and i also want to do GUI development. But I just
can't get started. At the risk of seeming stupid, here is where
I am. I generally move quickly between different languages
and development environments, but doing so requires some
clues and familiar concepts to transfer across.

My strategy is to just create a simple project and run it,
but I cannot even do that!

Notes:

* Seems to be a problem creating a Gambit project with a capital
letter as first character of name, as in "Test".
Error says "Test.product" is defining "test.product"

* When you remove a product, can't create one with same name
Says "Project already exists"

* Why does the "Gomuko" sample take 5 seconds to respond after a
click? This looks really bad.

* I can't figure out how the project/module system works. To try to
learn, I created a new Gambit project. Then I created a Gambit file:

test.scm:
------------------------------
(library test3.main gambit
  (define (foo)
    (print "Hello World"))
)
------------------------------

Then I edited the "product.jazz" file:
------------------------------
(library test3.product jazz

(import (test3.main))

(definition (run)
  (foo)
  (thread-sleep! 2.5))
------------------------------

But the error says "test3.main" not found. How does the project know
to include my module?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremie Lasalle Ratelle  
View profile  
 More options Mar 15, 7:28 pm
From: Jeremie Lasalle Ratelle <pouexmachi...@gmail.com>
Date: Sun, 15 Mar 2009 19:28:40 -0400
Local: Sun, Mar 15 2009 7:28 pm
Subject: Re: Problems using Jazz

I don't think you can load a gambit file like this in jazz.

Here's what I do :

I create a standard scheme file in my project directory, then in my
product.jazz :

(import (jazz.io))

(definition (run)
  (initialize-aliases)
  (set-current-directory {Directory User "lib" REST_OF_THE
PATH_TO_YOUR_SCHEME_FILE})
  (load YOUR_SCHEME_FILE))


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephane Le Cornec  
View profile  
 More options Mar 16, 6:58 pm
From: Stephane Le Cornec <stephane.lecor...@gmail.com>
Date: Mon, 16 Mar 2009 18:58:40 -0400
Local: Mon, Mar 16 2009 6:58 pm
Subject: Re: Problems using Jazz
Here's a short {repository package module library} explanation.
Suppose that you have a short program that you want to jazzify.

$ cat yankee.scm
(define (xray . rest)
  (map (lambda (x) (* x x)) rest))
$ cat bravo.scm
(load "yankee")
(display (xray 1 2 3))
(newline)
$ gsi bravo
149
$

Since we're going to modularize it, I will create 2 packages and move
those files into alpha and zulu.

$ cat ~/jazz_user/lib/Zilch/src/zulu/yankee.scm
(module zulu.yankee
(define (xray . rest)
  (map (lambda (x) (* x x)) rest)))
$ cat lib/Dummy/src/alpha/bravo.scm
(module alpha.bravo
(require (zulu.yankee))
(display (xray 1 2 3))
(newline))
$ jazz
JazzScheme v2.1.2 beta

> (jazz.load-module 'alpha.bravo)
149
> ,q

$

For every repository, Jazz will scan the folder structure of the
packages to find {alpha/bravo.scm alpha/bravo.jazz
alpha/bravo/_bravo.scm alpha/bravo/_bravo.jazz}. If it finds 2 of
these in the same repository, it fails.

Now, the code above will fails on the merest typo, which is not
something we want for Jazz. Library will code-walk and warn of free
symbols.

(library alpha.bravo scheme
(require (zulu.yankee))
(native xray)
(display (xray 1 2 3))
(newline))
or
(library alpha.bravo scheme
(import (zulu.yankee))
(display (xray 1 2 3))
(newline))

In these sample, all symbols are known. {library require} are special
forms, {native import} are imported from the core dialect, {display
newline} from the scheme dialect, xray is imported or declared as
native.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Guillaume Cartier  
View profile  
 More options Mar 18, 4:29 pm
From: Guillaume Cartier <gcart...@jazzscheme.org>
Date: Wed, 18 Mar 2009 16:29:40 -0400
Local: Wed, Mar 18 2009 4:29 pm
Subject: Re: Problems using Jazz

Could not reproduce this problem. It was probably fixed. Did you pull
the latest changes?

> * When you remove a product, can't create one with same name
> Says "Project already exists"

This is a misunderstanding due to a bad error message. It is not a
check for an existing project in the workbench but a check for an
existing directory where the project would end up being created. I
have improved the error message for all creation actions so that you
would now get :

Project already exists: C:/Home/jazz_user/lib/Test/

> * Why does the "Gomuko" sample take 5 seconds to respond after a
> click? This looks really bad.

It takes a long time because you are running the project interpreted
and both gomoku and c4 rely on a minimax algorithm to evaluate
variations to a depth of 4. But I totally aggree that for a newcomer
that doesn't know what is happening , it looks really bad. I added a
new module-uptodate-binary? primitive to return if a module has an
up-to-date binary and both projects are now using it to display a
warning message. Good point!

The element you are missing is: how does the module system find a
module? Given a module a.b.c how does it know what file to load that
will be defining the a.b.c module? As Stephane Le Cornec said, the
module system will try every package and assumes that inside a
package, module a.b.c will be found at one of the following :

  - a/b/c.scm
  - a/b/c.jazz
  - a/b/c/_c.scm
  - a/b/c/_c.jazz

This said, your test3.main library should then be in :
HOME/jazz_user/lib/Test/src/test3/main.scm. Note that a package can
define a starting 'root' for where its modules are located and by
default it is "src". This is why there is a /src/ in the above path.

PS: Be careful, the product run / update / build functions now receive
a 'descriptor' argument to have access to the product declaration
inside the package. Your run function will thus become :

(definition (run descriptor)
  (foo)
  (thread-sleep! 2.5))

Hope this helps make things clearer.

Guillaume Cartier


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google