NetLogo / NetLogo/Tortoise

Runtime error and type checking is incomplete

Open
#184 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
CoffeeScript
Stars
57
Forks
28
PR merge metrics
No merged PRs in 30d

Description

The NetLogo compiler does a lot of typechecking for us, but, as soon as value is stored into a variable or procedure argument, we lose the type information. As a result, all of the compiler's typechecking must be duplicated at runtime, as well. Unfortunately, currently, many primitives don't do a good job of that, as demonstrated, for example, in NetLogo/Galapagos#363, but there are countless other examples.

We should implement this at some point. But, of course, adding all of these runtime checks will definitely induce a performance decrease to the simulation engine. But that's cost of "correctness", I suppose....

(Some work is already in progress for this on the wip-middle-layer branch.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the wip-middle-layer branch and the failure described in NetLogo/Galapagos#363 first. Trace how types are lost when values enter variables or procedure arguments, then inventory the affected primitives; done would require complete runtime checking for the known cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
coffeescript, javascript
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.