• Stars
    star
    1,372
  • Rank 34,276 (Top 0.7 %)
  • Language
    Rust
  • License
    Other
  • Created almost 3 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

From JavaScript to Rust ebook

This repository houses an ebook-ified version of the 24+ post series started on vino.dev.

How to build

The ebook is built using asciidoctor and requires ruby >2.3.

Install the ruby dependencies via make deps

$ make deps

Build a PDF via the command make book

$ make book

Running code and projects

All code are housed in the src/ directory.

Day 4

  • cargo run -p day-4-hello-world
  • cargo run -p day-4-strings-wtf-1 - intentionally does not compile.
  • cargo run -p day-4-strings-wtf-2 - intentionally does not compile.

Day 5

Reassigning

  • JS: node javascript/day-5/let-vs-const/reassigning.js
  • Rust: cargo run -p day-5-let-vs-const --bin reassigning
  • cargo run -p day-5-let-vs-const --bin reassigning-wrong-type - intentionally does not compile

Borrowing

  • cargo run -p day-5-borrowing --bin borrow
  • cargo run -p day-5-borrowing --bin mutable-borrow - intentionally does not compile

Day 6

  • cargo run -p day-6-loads-of-strs --bin 200-unique-prints
  • cargo run -p day-6-loads-of-strs --bin 200-prints
  • cargo run -p day-6-loads-of-strs --bin 200-empty-prints
  • cargo run -p day-6-loads-of-strs --bin one-print

Day 7

Syntax

  • cargo run -p day-7-syntax

Day 8

Maps

  • ts-node javascript/day-8/src/maps.ts
  • cargo run -p day-8-maps

Structs

  • ts-node javascript/day-8/src/structs.ts
  • cargo run -p day-8-structs

Day 9

Day 10

Day 11

Modules

  • cargo run -p day-11-modules --bin nested-submodules
  • cargo run -p day-11-traffic-light

Day 12

  • cargo run -p day-12-impl-tostring
  • cargo run -p day-12-impl-asref-str

Day 13

  • cargo run -p day-13-option
  • cargo run -p day-13-result
  • cargo run -p day-13-question-mark

Day 14

From/Into

  • cargo run -p day-14-from-into

Errors

These examples require setting an environment variable. How to do that in your environment might look different.

  • MARKDOWN=README.md cargo run -p day-14-boxed-errors
  • MARKDOWN=README.md cargo run -p day-14-custom-error-type
  • MARKDOWN=README.md cargo run -p day-14-thiserror
  • MARKDOWN=README.md cargo run -p day-14-error-chain
  • MARKDOWN=README.md cargo run -p day-14-snafu

Day 16

Closures

  • cargo run -p day-15-closures

Day 16

Type differences

  • cargo run -p day-16-type-differences --bin impl-owned
  • cargo run -p day-16-type-differences --bin impl-borrowed

'static

  • cargo run -p day-16-static - intentionally does not compile
  • cargo run -p day-16-static-bounds - intentionally does not compile

Lifetime elision

  • cargo run -p day-16-elision

Unsafe pointers

  • cargo run -p day-16-unsafe-pointers

Day 17

Arrays

  • cargo run -p day-17-arrays
  • ts-node javascript/day-17/src/arrays.ts

Iterators

  • cargo run -p day-17-iterators
  • ts-node javascript/day-17/src/iterators.ts

Names example

  • cargo run -p day-17-names

Day 18

  • cargo run -p day-18-async --bin send-sync
  • cargo run -p day-18-async --bin simple
  • cargo run -p day-18-async --bin lazy
  • cargo run -p day-18-async --bin fs
  • cargo run -p day-18-async --bin async-blocks

Day 19

First you must cd into crates/day-19/project

  • cargo test
  • cargo run -p cli

Day 20

First you must cd into crates/day-20/project

  • RUST_LOG=cli=debug cargo run -p cli

Day 21

waPC runner

First you must cd into crates/day-21/project

  • cargo run -p cli -- crates/my-lib/tests/test.wasm hello "Potter"

waPC guest (hello)

First you must cd into crates/day-21/wapc-guest

  • Build with make

Day 22

Serde

  • cargo run -p day-22-serde

waPC runner

First you must cd into crates/day-22/project

  • cargo run -p cli -- crates/my-lib/tests/test.wasm hello hello.json
  • cargo run -p cli -- ./blog.wasm render ./blog.json

waPC guest (blog)

First you must cd into crates/day-22/wapc-guest

  • Build with make

Day 23

  • cargo run -p day-23-rc-arc --bin references
  • cargo run -p day-23-rc-arc --bin rc
  • cargo run -p day-23-rc-arc --bin arc
  • cargo run -p day-23-rc-arc --bin rwlock
  • cargo run -p day-23-rc-arc --bin async - intentionally does not compile

License

Book: Creative Commons BY-NC 4.0 Code: Creative Commons BY 4.0

More Repositories

1

preprocess

Preprocess HTML, JavaScript, and other files with directives based off custom or ENV configuration
JavaScript
363
star
2

grunt-preprocess

Preprocess files based off environment configuration
JavaScript
294
star
3

JavaScript-Particle-System

2d JavaScript Particle System with gravity field simulation
JavaScript
242
star
4

grunt-env

Grunt task to automate environment configuration for future tasks
JavaScript
224
star
5

grunt-plato

Generate static analysis reports with plato through grunt
JavaScript
206
star
6

hackium

TypeScript
175
star
7

shift-refactor

A suite of utilities to query and modify JavaScript source
TypeScript
131
star
8

grunt-open

Open urls and files from a grunt task
JavaScript
112
star
9

jquery.pulse.js

jQuery Pulse Animation Plugin
CSS
82
star
10

puppeteer-interceptor

Easy request interception/response modification for puppeteer
TypeScript
51
star
11

rcl

A websocket bridge for debug logging from browser to server
JavaScript
44
star
12

grunt-contrib-jasmine-example

Example application to help get you started using jasmine through grunt
JavaScript
42
star
13

grunt-strip

Strip JavaScript nodes (like console.*) out of your source code
JavaScript
42
star
14

deobfuscating-js-streams

JavaScript
27
star
15

gitfaq

organized git faq
SCSS
26
star
16

workshop-reverse-engineering

JavaScript
23
star
17

shift-interpreter

TypeScript
22
star
18

jsconsole

JavaScript console/repl styled after chrome devtools.
JavaScript
22
star
19

RetwisJS

Port of Redis's Twitter clone, retwis for node.js
19
star
20

puppeteer-extra-interceptor

Puppeteer-extra plugin for puppeteer-interceptor
TypeScript
18
star
21

es6repl

reusable babel repl
JavaScript
15
star
22

Backbone.Augment

Simple plugin/addon functionality for Backbone Views, Models, and Collections.
JavaScript
15
star
23

puppeteer-extensionbridge

Expose the Chrome extension API to puppeteer
TypeScript
13
star
24

javascript-deobfuscation-AMA

General questions about deobfuscating JavaScript
13
star
25

grunt-jasmine-runner-example

Example setup for grunt-jasmine-runner
JavaScript
12
star
26

badjs.org

CSS
12
star
27

shift-query-cli

Command line tool to query AST nodes in JavaScript source files.
JavaScript
11
star
28

combolist-generator

JavaScript
10
star
29

texture.js

Basic implementation of normal mapped textures in javascript
JavaScript
10
star
30

stream-unzip

A streaming unzip library for rust projects
Rust
9
star
31

html5hub-particlesystem

Particle System demo for html5hub
JavaScript
8
star
32

js-identifiers

JavaScript
8
star
33

karma-commonjs-example

Example repo showing commonjs tests running on command line as well as in karma
JavaScript
7
star
34

shift-visualizer

Visualizer for the Shift AST format
JavaScript
5
star
35

string-format

Sprintf inspired string format method.
JavaScript
5
star
36

typescript-boilerplate

Boilerplate TypeScript project with mocha, eslint, prettier, and Visual Studio Code preconfigured
TypeScript
4
star
37

refactor-plugin-common

TypeScript
4
star
38

shift-identifiers

Find similar identifiers across a source file
JavaScript
4
star
39

marionette.augment.inlineregions

JavaScript
4
star
40

grunt-require-dir

Task to bundle up a directory of AMD modules into one accessor module
JavaScript
3
star
41

fromgit

TypeScript
3
star
42

shift-complexity

Complexity analysis for JavaScript source code.
JavaScript
3
star
43

liquid-json

A library to parse structured JSON with embedded liquid templates
Rust
3
star
44

apex-wip

TypeScript
3
star
45

hackium-plugin-visiblecursor

JavaScript
3
star
46

box2d-intro-amd

Seth Ladd's excellent box2d intro migrated to a modular structure with requirejs.
JavaScript
3
star
47

gh-cloneall

Utility to clone all github repos for a user or organization
JavaScript
3
star
48

concentric-circle-illusion

Visualization on html canvas of the classic optical illusion http://i.imgur.com/p2yeT.jpg
JavaScript
3
star
49

AMD_RequireJS-slides

Talk given to SanDiegoJS on Jan 10, 2012
JavaScript
2
star
50

believable

TypeScript
2
star
51

randomfarts.com

HTML
2
star
52

AMD-urlParams

A query string parser in AMD format for require.js, curl.js, etc
JavaScript
2
star
53

auto-cli-replay

Automatically create CLI GIFs with simulated typing, dynamic interactivity, and more.
Shell
2
star
54

git-spread

Run git commands across multiple directories
Shell
2
star
55

es6-repl

web component wrapping the es6repl
JavaScript
2
star
56

interpreter-context-jsdom

TypeScript
2
star
57

widl2json

WIDL to JSON converter
JavaScript
2
star
58

hackium-plugin-preserve-native

TypeScript
2
star
59

chrome-devtools-slides

Slides for sandiego.js July talk
JavaScript
2
star
60

jsperf-common

List of good jsperf benchmarks for common situations
1
star
61

browserusage.org

Site to simply display worldwide browser usage stats.
CSS
1
star
62

wacl

Rust
1
star
63

perl-Parallel-Forking-Manager

Thread manager for Moose objects with role 'Forking'
Perl
1
star
64

gcp-simple-secrets

TypeScript
1
star
65

cordova-flashcard-app

Objective-C
1
star
66

perl-MooseX-Role-Forking

Forking/Threading role for Perl Moose
Perl
1
star
67

refactor-plugin-unsafe

TypeScript
1
star
68

lockyourdamncomputer.com

CSS
1
star
69

phaser-mario

JavaScript
1
star
70

python-game

Python
1
star
71

example-cli

Rust
1
star
72

gh-action-test

TypeScript
1
star
73

dotfiles

Shell
1
star
74

jsoverson.github.com

stub
1
star
75

fromgit-test

1
star
76

mp-tuning

Rust
1
star
77

allfaqs

HTML
1
star
78

wapc-rust-template

Makefile
1
star
79

apex-template

TypeScript
1
star
80

seeded-random-utils

TypeScript
1
star
81

wit-example

Rust
1
star
82

d3-starter

basic repo that includes what's necessary to experiment with d3
CSS
1
star