Code Monkey home page Code Monkey logo

jacscript's Introduction

DeviceScript

TypeScript for Tiny IoT Devices.

DeviceScript brings a TypeScript developer experience to low-resource microcontroller-based devices. DeviceScript is compiled to a custom VM bytecode, which can run in very constrained environments.

Experimental Project from Microsoft Research - Join the discussions to provide feedback.

blinky.mp4

Contributing

Contributions are welcome! See contributing page.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

jacscript's People

Contributors

artofthesmart avatar arxenix avatar bartmichu avatar bdombro avatar bohemus307 avatar djessup avatar eltociear avatar emmanuel-ferdman avatar faridonfire avatar iamsadat avatar jurosh avatar kevinl10 avatar microsoft-github-operations[bot] avatar microsoftopensource avatar mmoskal avatar okazkayasi avatar pelikhan avatar piotrkasperski avatar reghardt avatar rudy3333 avatar sanjaiyan-dev avatar schaestewart avatar semantic-release-bot avatar sh33dafi avatar tanmay53 avatar tballmsft avatar tmacam avatar xmeow avatar zikalino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jacscript's Issues

Check ds version

Check that devicescript version is good enough when deploying

UTF8 string indexing

The plan is for the method String.charCodeAt() to returns a Unicode code point (up to 21 bits), not UTF-16 character.
Similarly, String.length will return the number of 21-bit code points. Currently, they both assume strings is ASCII.

Once the UTF8 indexing is implemented, we need skip lists or similar in string, so that the following is reasonably fast:

let s = "ż" // force unicode
for (let i = 0; i < 2000; ++i) {
  s += "x"
}
for (let i = 2; i < s.length; ++i) {
  ds.assert(s[i] == "x")
  ds.assert(s.charCodeAt(i) == 0x78)
}

useshell on windows doesn't work

PS C:\github\devicescript\vscode\sampleprj> yarn devicescript devtools --vscode
yarn : File C:\Users\tball\AppData\Roaming\npm\yarn.ps1 cannot be loaded 
because running scripts is disabled on this system. For more information, see 
about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.    
At line:1 char:1
+ yarn devicescript devtools --vscode
+ ~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException  
    + FullyQualifiedErrorId : UnauthorizedAcyarn devicescript devtools --vscode\github\devicescript\vscode\sampleprj>
yarn : File C:\Users\tball\AppData\Roaming\npm\yarn.ps1 cannot be loaded 
because running scripts is disabled on this system. For more 
information, see about_Execution_Policies at 
https:/go.microsoft.com/fwlink/?LinkID=135170.

show terminal on run/debug

When we start debugging or run the program we should show the terminal window - it has nice colored output. I don't think showing the "output" is very useful (too much stuff in there)

yarn setup missing

following install instructions, from a fresh repo, "yarn setup" fails. Also, get the message:

  • warning package-lock.json found. Your project contains lock files generated by tools other than Yarn.
$ yarn setup
yarn run v1.22.19
warning package.json: No license field
error Command "setup" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

$ yarn
yarn install v1.22.19
warning package.json: No license field
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
warning No license field
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.46s.

accelerometer events not firing up

on micro:bit microcode, the shake event does not trigger

var dotMatrix1 = roles.dotMatrix()
var accelerometer1 = roles.accelerometer()
accelerometer1.shake.subscribe(() => {
    dotMatrix1.dots.write(hex`000e0e0e00`)
    wait(1)
    dotMatrix1.dots.write(hex`1f1111111f`)
})

folder with files in the @devicescript/core package?

I would like to run TypeDoc on the @devicescript/core package files so that we get an online documentation for those types. I need a folder with a tsconfig.json and an entry .ts file.

Is ./devs/lib/ the best place for that?

string concatenation is qudratic

This should run reasonably fast, but doesn't.

let s = ""
for (let i = 0; i < 2000; ++i) {
  s += "x"
}
ds.assert(s.length == 2000 && s[100] == "x")

API class names

We should review the class names in our API layer:

  • use of abbreviations? Maybe full words is better
  • can we have RegisterBoolean?

multiple DS Simulators panes starting

repro:

  • start debugging with the "Play" button
  • wait for the sim panel to open
  • restart extension
  • start debugging again with Play
  • see two (or three or four ...) sim panels

rename vm description

It currently says "jacdac-posix device". we need someting more intuitive to show in the tree.

shorten title of extension

most VS Code extensions do not have "VS Code Extension" in their title

  • shorten "DeviceScript Visual Studio Code Extension" to "DeviceScript"
  • shorten "Visual Studio Code Extension for DeviceScript" to "DeviceScript"

implicitly call `.toString()` (maybe)

The concatenation operator (+) as well as the indexing operator need to convert arguments to string. This may involve calling user-defined .toString() method.

The plan:

  • add a flag to devs_activation saying it's an implicit toString frame
  • when .toString() needs to be called move back pc by one, copy any stack items, attach them to the activation frame for toString(), reset stack to zero
  • upon return from toString frame - restore stack, in the calling opcode skip stuff based on the toString flag somehow

Alternative - STMT2_PLUS - stack is always empty

Alternative currently preferred - don't call .toString() implicitly and have the compiler warn about .toString()

failure: npm install -g -u @devicescript/cli

$ npm install -g -u @devicescript/cli
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@devicescript%2fdap - Not found
npm ERR! 404
npm ERR! 404  '@devicescript/dap@*' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\tball\AppData\Local\npm-cache\_logs\2023-01-27T21_32_04_888Z-debug-0.log

better error object

  • don't leak file (it's an internal data object to TypeSCript
  • line number
  • string categories instead of numbers

regular debug flow fails

The default way to start a debug session is to press the debug button or hit f5. VS Code then suggest to pick a debugger + file. We need to support this scenario.

(also the button we use gets hitten when multi-tabs)

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.