Code Monkey home page Code Monkey logo

Comments (8)

dyoo avatar dyoo commented on August 21, 2024

Bug. Whenever link: module mismatches happen, that's a bug. It should have been a runtime error.

Does it still happen if you redo a 'raco make' on the whalesong source files?

from whalesong.

soegaard avatar soegaard commented on August 21, 2024

I tried the following:

  • looked for Whalesong folders in the PLaneT cache
    (there were none due to the development link)
  • changed folder to Whalesong source folder
  • deleted all contents from compiled folders
    rm -rf compiled/
    rm -rf * / compiled/
    rm -rf * / * / compiled/
    etc
    • ran the setup Whalesong script in stxmat-excises:
      sh scripts/setup-whalesong.sh
      raco setup -P dyoo whalesong.plt 2 1
    • ran stxmat-exercises.rkt in DrRacket and got the error again
      Note that running the Whalesong compiler on the same file works fine.

So although a "link: module mismatch ..." error normally means old
bytecode is lying around, I am a bit suspicious of the macro
declare-implementation which is used to export call-method in js/main.rkt.

Note:
My source files starts as follows:

#lang at-exp planet dyoo/whalesong
(require (planet dyoo/whalesong/js))
... source that contains call-method ...

Now, if I change this to

#lang at-exp planet dyoo/whalesong
(require (planet dyoo/whalesong/js/racket-impl))

then the program runs as expected in DrRacket.
This suggests that declare-implemenation could be the culprit.

from whalesong.

dyoo avatar dyoo commented on August 21, 2024

I will look at this. The thing is that I can't reproduce the error: when I try using call-method in DrRacket, it errors out predictably with the intended runtime error, rather than the weird "link: module mismatch" business. I'll check out your project and try duplicating the error from there.

from whalesong.

soegaard avatar soegaard commented on August 21, 2024

This program generates the error for me.

#lang at-exp planet dyoo/whalesong
(require (planet dyoo/whalesong/js))
(call-method "foo")

The error message:
link: module mismatch, probably from old bytecode whose dependencies have changed: variable not provided (directly or indirectly) from module: "/Users/soegaard/Dropbox/GitHub/stxmat-exercises/whalesong/current/js/main.rkt" accessed from module: 'anonymous-module at source phase level: 0 in: call-method

The output from "planet show" is:

Normally-installed packages:
dyoo closure-compile.plt 1 2
dyoo version-case.plt 1 9

Development links:
dyoo whalesong.plt 2 1
--> /Users/soegaard/Dropbox/GitHub/stxmat-exercises/whalesong/current

from whalesong.

dyoo avatar dyoo commented on August 21, 2024

On Thu, Aug 25, 2011 at 3:34 PM, soegaard
[email protected]
wrote:

This program generates the error for me.

#lang at-exp planet dyoo/whalesong
(require (planet dyoo/whalesong/js))
(call-method "foo")

Something strange must be happening at the development link level,
then. Either that or the version of Whalesong on github now is not
what you've got.

When I try to replicate the bug, I do get the right error message:


fermi ~ $ cat foo.rkt
cat foo.rkt
#lang at-exp planet dyoo/whalesong
(require (planet dyoo/whalesong/js))
(call-method "foo")

fermi ~ $ racket foo.rkt
racket foo.rkt
procedure call-method: expects at least 2 arguments, given 1: "foo"

=== context ===
/gpfs/main/home/dyoo/foo.rkt: [running body]

fermi ~ $ planet show
planet show
Normally-installed packages:
dyoo browser-evaluate.plt 1 0
dyoo closure-compile.plt 1 2
dyoo version-case.plt 1 9

Development links:
dyoo whalesong.plt 1 3
--> /gpfs/main/home/dyoo/work/whalesong

from whalesong.

soegaard avatar soegaard commented on August 21, 2024

A new piece to the puzzle.
I can now turn the error on and off!

  • In DrRacket choose the menu "Language" and the menu item "Choose Language".
  • Click the button "Show Details"
  • Toggle the setting "Populate 'compiled' directories (for faster loading)

If the setting is on, I get the error.
If the setting is off, I don't get the error.

from whalesong.

dyoo avatar dyoo commented on August 21, 2024

On Thu, Aug 25, 2011 at 5:04 PM, soegaard
[email protected]
wrote:

A new piece to the puzzle.
I can now turn the error on and off!

  • In DrRacket choose the menu "Language" and the menu item "Choose Language".
  • Click the button "Show Details"
  • Toggle the setting "Populate 'compiled' directories (for faster loading)

If the setting is on, I get the error.
If the setting is off, I don't get the error.

Ah. Ok. Try leaving "populate compiled directories" on, but turn off
debugging support. I suspect that what is happening now is DrRacket's,
which itself does some funky stuff with bytecode loading.

from whalesong.

soegaard avatar soegaard commented on August 21, 2024

With "Populate" and no debug, the program works as intended.

from whalesong.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.