Giter VIP home page Giter VIP logo

munificent / craftinginterpreters Goto Github PK

View Code? Open in Web Editor NEW
8.1K 162.0 980.0 23.1 MB

Repository for the book "Crafting Interpreters"

Home Page: http://www.craftinginterpreters.com/

License: Other

Makefile 0.47% CSS 0.94% HTML 83.67% C 4.83% Java 4.42% Shell 0.01% JavaScript 0.07% Dart 4.62% SCSS 0.98%
language parser bytecode java c scripting-language book markdown lox compiler interpreter

craftinginterpreters's Introduction

This is the repo used for the in-progress book "Crafting Interpreters". It contains the Markdown text of the book, full implementations of both interpreters, as well as the build system to weave the two together into the final site.

If you find an error or have a suggestion, please do file an issue here. Thank you!

Contributing

One of the absolute best things about writing a book online and putting it out there before it's done is that people like you have been kind enough to give me feedback, point out typos, and find other errors or unclear text.

If you'd like to do that, great! You can just file bugs here on the repo, or send a pull request if you're so inclined. If you want to send a pull request, but don't want to get the build system set up to regenerate the HTML too, don't worry about it. I'll do that when I pull it in.

Ports and implementations

Another way to get involved is by sharing your own implementation of Lox. Ports to other languages are particularly useful since not every reader likes Java and C. Feel free to add your Lox port or implementation to the wiki:

Building Stuff

I am a terribly forgetful, error-prone mammal, so I automated as much as I could.

Prerequisites

I develop on an OS X machine, but any POSIX system should work too. With a little extra effort, you should be able to get this working on Windows as well, though I can't help you out much.

Most of the work is orchestrated by make. The build scripts, test runner, and other utilities are all written in Dart. Instructions to install Dart are here. Once you have Dart installed and on your path, run:

$ make get

This downloads all of the packages used by the build and test scripts.

In order to compile the two interpreters, you also need a C compiler on your path as well as javac.

Building

Once you've got that setup, try:

$ make

If everything is working, that will generate the site for the book as well as compiling the two interpreters clox and jlox. You can run either interpreter right from the root of the repo:

$ ./clox
$ ./jlox

Hacking on the book

The Markdown and snippets of source code are woven together into the final HTML using a hand-written static site generator that started out as a single tiny Python script for my first book and somehow grew into something approximating a real program.

The generated HTML is committed in the repo under site/. It is built from a combination of Markdown for prose, which lives in book/, and snippets of code that are weaved in from the Java and C implementations in java/ and c/. (All of those funny looking comments in the source code are how it knows which snippet goes where.)

The script that does all the magic is tool/bin/build.dart. You can run that directly, or run:

$ make book

That generates the entire site in one batch. If you are incrementally working on it, you'll want to run the development server:

$ make serve

This runs a little HTTP server on localhost rooted at the site/ directory. Any time you request a page, it regenerates any files whose sources have been changed, including Markdown files, interpreter source files, templates, and assets. Just let that keep running, edit files locally, and refresh your browser to see the changes.

Building the interpreters

You can build each interpreter like so:

$ make clox
$ make jlox

This builds the final version of each interpreter as it appears at the end of its part in the book.

You can also see what the interpreters look like at the end of each chapter. (I use this to make sure they are working even in the middle of the book.) This is driven by a script, tool/bin/split_chapters.dart that uses the same comment markers for the code snippets to determine which chunks of code are present in each chapter. It takes only the snippets that have been seen by the end of each chapter and produces a new copy of the source in gen/, one directory for each chapter's code. (These are also an easier way to view the source code since they have all of the distracting marker comments stripped out.)

Then, each of those can be built separately. Run:

$ make c_chapters

And in the build/ directory, you'll get an executable for each chapter, like chap14_chunks, etc. Likewise:

$ make java_chapters

This compiles the Java code to classfiles in build/gen/ in a subdirectory for each chapter.

Testing

I have a full Lox test suite that I use to ensure the interpreters in the book do what they're supposed to do. The test cases live in test/. The Dart program tool/bin/test.dart is a test runner that runs each of those test files on a Lox interpreter, parses the result, and validates that that the test does what it's expected to do.

There are various interpreters you can run the tests against:

$ make test       # The final versions of clox and jlox.
$ make test_clox  # The final version of clox.
$ make test_jlox  # The final version of jlox.
$ make test_c     # Every chapter's version of clox.
$ make test_java  # Every chapter's version of jlox.
$ make test_all   # All of the above.

Testing your implementation

You are welcome to use the test suite and the test runner to test your own Lox implementation. The test runner is at tool/bin/test.dart and can be given a custom interpreter executable to run using --interpreter. For example, if you had an interpreter executable at my_code/boblox, you could test it like:

$ dart tool/bin/test.dart clox --interpreter my_code/boblox

You still need to tell it which suite of tests to run because that determines the test expectations. If your interpreter should behave like jlox, use "jlox" as the suite name. If it behaves like clox, use "clox". If your interpreter is only complete up to the end of one of the chapters in the book, you can use that chapter as the suite, like "chap10_functions". See the Makefile for the names of all of the chapters.

If your interpreter needs other command line arguments passed to use, pass them to the test runner using --arguments and it will forward to your interpreter.

Repository Layout

  • asset/ – Sass files and jinja2 templates used to generate the site.
  • book/ - Markdown files for the text of each chapter.
  • build/ - Intermediate files and other build output (except for the site itself) go here. Not committed to Git.
  • c/ – Source code of clox, the interpreter written in C. Also contains an XCode project, if that's your thing.
  • gen/ – Java source files generated by GenerateAst.java go here. Not committed.
  • java/ – Source code of jlox, the interpreter written in Java.
  • note/ – Various research, notes, TODOs, and other miscellanea.
  • note/answers – Sample answers for the challenges. No cheating!
  • site/ – The final generated site. The contents of this directory directly mirror craftinginterpreters.com. Most content here is generated by build.py, but fonts, images, and JS only live here. Everything is committed, even the generated content.
  • test/ – Test cases for the Lox implementations.
  • tool/ – Dart package containing the build, test, and other scripts.

craftinginterpreters's People

Contributors

aakshintala avatar benhoyt avatar catharsis avatar engyrus avatar greenlightning avatar hamled avatar harrisi avatar iffyio avatar initram avatar invertego avatar iwatakeshi avatar martica avatar mattpd avatar mchlrhw avatar michaelmalonenz avatar minond avatar mrahhal avatar munificent avatar nirs avatar owlblocks avatar rkirsling avatar rljacobson avatar rwaskiewicz avatar ryanplusplus avatar silmeth avatar thiagoarrais avatar thomas-neill avatar timmyjose avatar timsneath avatar wbroach 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  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

craftinginterpreters's Issues

Scanning

possible changes

  • why System.exit with 65?
  • "parenthsized" typo
  • "then do…” That" - should there be a period after the end-quote mark?
  • "determine that from" - "that" refers to something in the previous paragraph so I had to do a double take to figure out what "that" was as my mind had removed that mental stack frame.
  • the word "token" is used a few paragraphs before being defined. Unfortunately, I totally understand why. There's a chicken and egg situation here. Still, it felt odd.
  • "identifier" used but I didn't understand what it meant. The word is also defined in "A Map of the Territory" but I'd forgotten what it might altogether. In fact, I'd forgotten I'd ever read it and only found it through Ctrl+F.
  • "It works its" => "The scanner works its"
  • "close cousins the reserved words" - maybe add comma after "cousins"

questions and comments

  • The grayed out code with only the important line in black works really well. Very easy to read.
  • This is out there. Is it possible to have an entirely unicode language? Like imagine all keywords and variables name and everything in Chinese. Is that just as easy nowadays as ASCII based? Think of the line character count if everyone used Chinese variable names!

Sources modified during the build

Making modifies sources, so your next commit will include these unwanted changes.

$ make
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   site/representing-code.html
	modified:   site/scanning.html
	modified:   site/the-lox-language.html

no changes added to commit (use "git add" and/or "git commit -a")

A Map of the Territory

https://youtu.be/_t8hpEKb4gk

The old rules apply. Rather than edit and pull request, I'll just point out some stuff with bullet points and let you decide which make sense. Much of what I say may be too picky so feel free to ignore any number of the bullet points.

possible errors

  • "languages designers" => "language designers"
  • "Then target backends" reads like a sentence fragment, consider "Target backends then"
  • "YARV is A Bytecode Virtual Machine." - unusual casing in this sentence.
  • "artifical" - typo.
  • "virtual machine (“VM”)" - VM being in quotes just struck me as odd.

clarifications

  • what's the difference between a VM and interpreter? I'm still not sure after reading.

Suggestion: add interpreter setup instructions

Hi, loving the book so far. Quick suggestion. In the intro to section 3 you suggest that readers can use your interpreter while they read through the book:

A tutorial isn’t very fun if you can’t try the code out yourself. Alas, you don’t have a Lox interpreter yet, since you haven’t built one!

Fear not. You can use mine. [ link to this repo ]

I think it would be helpful to add setup instructions to the README here, I definitely don't know where to get started.

typo in II.6.3

Minimize cascaded errors. Once a single error is found, the parser no longer really knows what's going on. It tries to get itself back on track and keep going, but if it gets confused, it may report a slew of ghost errors that don't indicate other real problems in the code. When the first error is fixed, they disappear, because they merely represent the parser's own confusion. These are annoying because they can scare the user into thinking their code is in a worst state than it is.

Trailing comma in "Metaprogramming the trees" causes a syntax error

Loving the book so far, thank you!

I think I found a minor syntax error:

In the code snippet from: http://www.craftinginterpreters.com/representing-code.html#metaprogramming-the-trees

    defineAst(outputDir, "Expr", Arrays.asList(
      "Binary   : Expr left, Token operator, Expr right",
      "Grouping : Expr expression",
      "Literal  : Object value",
      "Unary    : Token operator, Expr right",
    ));

The comma after Unary causes (at least my javac 1.8.0_121) to emit

Error(24, 9) java: illegal start of expression

Adding number and string should work?

According to 3.4.1:

If either operand of + is a string, then the other operand is converted to a string (if it isn’t already one) and the results are concatenated.

But both interpreter currently say:

Operands must be two numbers or two strings.

typos in book/introduction.md

"inflation in the jargon economy lead today" -> "inflation in the jargon economy led today"

"overhwelmed" -> "overwhelmed"

New challenge for Chapter 3

Section 1.3 gives a great description of bootstrapping. After the description of Lox in Chapter 3 I think an interesting challenge would be:

Is it possible to bootstrap Lox with one of the given Lox implementations?
Why or why not?

I spent some time actually trying this and it was a very interesting exercise in terms of discovering the limits of the language. As I hit limits I would alter the jlox implementation (via a builtin or language feature) to keep going. We'll see how far I get :-)

init method section 3.9.5

In section 3.9.5:

class Breakfast {
  init(meat, bread) {
    this.meat = bread;
    this.bread = bread;
  }

I believe you meant
this.meat = meat

typo

Chapter 4, section 4.4, second code example:
// We are the beginning of the next lexeme. should be:
// We are at the beginning of the next lexeme.

Unable to run Lox breakfast sample code

I'm trying to do challenge 1 at the end of chapter 3 and write a sample Lox program and run it using you example interpreter. I got the interpreter compile very easily with make as indicated in #8.

If I do a basic example with a class (Breakfast - just like your samples) it works fine and I get the expected output of Enjoy your ham and toast, Dear Reader but when I try and do inheritance (Brunch) I get the error Only instances have fields. [line 3]. I'm overriding both serve and init and in the overriding init I call super.init.

Working code:

class Breakfast {
  init(meat, bread) {
    this.meat = meat;
    this.bread = bread;
  }

  serve(who) {
    print "Enjoy your " + this.meat + " and " + this.bread + ", " + who;
  }
}

var baconAndToast = Breakfast("ham", "toast", "tea");
baconAndToast.serve("Dear Reader");

Code that errors:

class Breakfast {
  init(meat, bread) {
    this.meat = meat;
    this.bread = bread;
  }

  serve(who) {
    print "Enjoy your " + this.meat + " and " + this.bread + ", " + who;
  }
}

class Brunch < Breakfast {
  init(meat, bread, drink) {
    super.init(meat, bread);
    this.drink = drink;
  }

  serve(who) {
    print "Enjoy your " + this.meat + " and " + this.bread + " and " + this.drink + ", " + who;
  }
}

var baconAndToastAndTea = Brunch("ham", "toast", "tea");
baconAndToastAndTea.serve("Dear Reader");

Any help here would be much appreciated.

The Lox Language (chapter)

possible errors (if being really picky)

  • copyright year is 2015, I forgot to point this out earlier
  • "Ritchie had this idea called ..." - This might be nothing but the reader might have forgotten who "Ritchie" is, as he was only briefly mentioned in an earlier chapter:
    • "You don’t have to be the reincarnation of Dennis Ritchie"
  • the term "Ref counting" isn't formally introduced. "Reference counting is and then "Ref counting" is used. This is me being super picky.
    • "There are two main techniques for managing memory: reference counting and tracing garbage collection (usually just called “garbage collection” or “GC”). Ref counters are much ..."
    • could say something like "reference (ref) counting" or something a bit better. I don't have a great solution here.
  • The term "literal" is used. This is first used just once in "A Map of the Territory":
    • "Others may be several characters long, like numbers (123), string literals ("hi!"), and identifiers (min)."
      I don't believe "literal" is defined anywhere. I have similar feelings with other terms like "expressions" etc.. It might be worth having a glossary or something to that effect.
  • "Functions are first-class in Lox" - I don't think "first-class" is defined.
  • sometimes "first-class", sometimes "first class".

comments

  • I love how the "Unified Theory of Garbage Collection" PDF name is "bacon-garbage".

Compilation error on Ubuntu 14.04 w/ Java 1.7

I ran into the following when compiling the code:

make[1]: Entering directory `/home/craig/Downloads/craftinginterpreters-master'
java/com/craftinginterpreters/lox/Interpreter.java:42: error: ')' expected
    globals.define("clock", new NativeFunction(0, this::clock));
                                                      ^
java/com/craftinginterpreters/lox/Interpreter.java:42: error: ';' expected
    globals.define("clock", new NativeFunction(0, this::clock));
                                                       ^
java/com/craftinginterpreters/lox/Interpreter.java:42: error: not a statement
    globals.define("clock", new NativeFunction(0, this::clock));
                                                        ^
java/com/craftinginterpreters/lox/Interpreter.java:42: error: ';' expected
    globals.define("clock", new NativeFunction(0, this::clock));
                                                             ^
java/com/craftinginterpreters/lox/Interpreter.java:42: error: constructor NativeFunction in class NativeFunction cannot be applied to given types;
    globals.define("clock", new NativeFunction(0, this::clock));
                            ^
  required: int,JavaFunction
  found: int,Interpreter
  reason: actual argument Interpreter cannot be converted to JavaFunction by method invocation conversion
java/com/craftinginterpreters/lox/Resolver.java:294: error: method push in class Stack<E> cannot be applied to given types;
    scopes.push(new HashMap<>());
          ^
  required: Map<String,Boolean>
  found: HashMap<Object,Object>
  reason: actual argument HashMap<Object,Object> cannot be converted to Map<String,Boolean> by method invocation conversion
  where E is a type-variable:
    E extends Object declared in class Stack
6 errors
make[1]: *** [build/java/com/craftinginterpreters/lox/Callable.class] Error 1
make[1]: Leaving directory `/home/craig/Downloads/craftinginterpreters-master'
make: *** [jlox] Error 2

Pretty sure the answer is "You have an old Java version" but may want to state that the version needed is newer than 1.7.

Thanks!

Missing information about status.

The document is copyright 2015 but only has the first 4 chapters. The rest say "coming soon!" but that's obviously not true. Please do your readers a favor and include information about the actual status and progress of this book and when they can realistically expect to see the rest of it. As it is, reading this is a waste of time when so much of the document is missing. Also it's a waste of time to post issues about the content, which I had intended to do.

Wiki page for implementations

How about a wiki page for implementations in other languages? That would minimize PRs. With time the list will be too long for the README anyway.

Js semicolon ignoring

" It treats all of your semicolons as meaningless whitespace unless it encounters a parse error."

I think that's supposed to be newlines.

Dangling next pointer in vm.objects linked list?

Hey there. I'm a programming language enthusiast and I'm trying to understand how garbage collection works by reading your code. I'm new to C as well. So please excuse me for my ignorance and feel free to close the issue if it's moot.

I'm referring to the collectGarbage() (line 273 in memory.c).

From my understanding, vm.objects is a linked list of objects that are dynamically allocated. In line 273, when you free an object, I assume the next pointer gets freed as well. So when you traverse the linked list again, the objects after the freed object will not be accessed due to the dangling next pointer of the previous object (which is pointing to the freed object).

Since the next pointer of the previous object is not updated to point to the object after the freed object, I'm having a hard time understanding how this could work.

As I am new to C, my understanding may not be correct and there may be subtleties that I've missed. Please feel free to correct me otherwise!

typo in the-lox-language

In the Instantiation and Initialization subsection of the Classes section. I believe the line

this.meat = bread;

should be

this.meat = meat;

Object types

Can you please explain, what are those object types:

typedef enum {
//> Methods and Initializers not-yet
  OBJ_BOUND_METHOD,
//< Methods and Initializers not-yet
//> Classes and Instances not-yet
  OBJ_CLASS,
//< Classes and Instances not-yet
//> Closures not-yet
  OBJ_CLOSURE,
//< Closures not-yet
//> Calls and Functions not-yet
  OBJ_FUNCTION,
//< Calls and Functions not-yet
//> Classes and Instances not-yet
  OBJ_INSTANCE,
//< Classes and Instances not-yet
//> Calls and Functions not-yet
  OBJ_NATIVE,
//< Calls and Functions not-yet
  OBJ_STRING,
//> Closures not-yet
  OBJ_UPVALUE
//< Closures not-yet
} ObjType;

Source code

OBJ_STRING is string, OBJ_INSTANCE, OBJ_FUNCTION and OBJ_CLASS are understandable, but what are all other for?

typo in code

In Chapter 3, section 3.9.5, in the third code block there is:

this.meat = bread;
this.bread = bread;

I believe the first line there should be this.meat = meat;

Sidenote about generating java code

The java compiler can be run from within a Java program. Kinda cool thing to point out in a side note. Definitely a bad idea to actually do in the book, but a nice thing to point out in a side note.

Please provide a printed example of visitor interface for an Expression

I've never coded in Java but I've been able to follow along the code in the book and translate it to my language of choice (Xojo). Where I'm struggling (and I think others might too) is visualising the output of your helper tool GenerateAst as I can't figure out how to compile the visitor interfaces for the various Expression subclasses. Trying to visualise this:

private static void defineVisitor(
      PrintWriter writer, String baseName, List<String> types) {
    writer.println("  interface Visitor<R> {");

    for (String type : types) {
      String typeName = type.split(":")[0].trim();
      writer.println("    R visit" + typeName + baseName + "(" +
          typeName + " " + baseName.toLowerCase() + ");");
    }

    writer.println("  }");
  }

in my head hurts. Would it be possible to either provide a compiled binary of the GenerateAst tool for those of us who have never used Java or at least provide a few more code snippets of completed classes for easier visualisation?

Does the comma operator really need its own syntax tree node?

In the chapter 6 challenge to add comma expressions it says

...(You will have to define a new syntax tree node for a comma expression too.)...

and this is how it’s done in the answers too.

Is this really true—isn’t it just another binary operator? In my solution I have used Expr.Binary with , as the operator and everything (as far as I can tell) works fine.

Looking at the history, this challenge was recently changed from implementing increment and decrement operators, which would need a new tree node (or at least changing the existing unary node).

So is the current language a remnant from the original challenge, or is the comma operator so special that it gets it own node whilst all the other binary operators have to share one between them?

producting

In the side note of 6.3.2 it says The parser safely parses it but then reports it as an error instead of producting a syntax tree.

I believe the word producting here should be producing.

Hide navigation bar in CSS when rendering the page for printing

Hey, so I'm really enjoying reading this, but as I have very little access to the interwebz, getting all the libs for the python build system is a pain, and printing it from a browser looks like shit (and removes all the fun side-comments) I was wondering if you could add a PDF version? I don't care if it's not super-pretty, but just having a version I can dl easily and read on my ereader would be nice!

Thanks and keep up the awesome book!! 😺

clox: Closure being set to nil after being called

See the next code (I've minimized the original to showcase the bug):

fun caller(g) {
	print "in caller: g before calling it: ";
	print g;

	g();

	print "in caller: g after calling it (should not be nil!): ";
	print g;
}

fun callCaller() {
	var capturedVar = nil;

	fun g() {
		// Commenting the next line out prevents the bug!
		capturedVar = 123;

		// Returning anything also fixes it, even nil:
		// return nil;

		// Or moving callCaller's code to the top level.
	}

	caller(g);
}

callCaller();

Running this with clox prints:

in caller: g before calling it: 
<fn 0x7fbb39c03e20>
in caller: g after calling it (should not be nil!): 
nil

jlox works as expected.

Reference & value semantics

In chapter 3, when you introduce classes, you explain that we can pass objects to functions.
Wouldn't be worth it to talk about value semantics and reference semantics ? What happens if I pass an object to a function and that function calls a method that mutates the object ?

Maybe I'm a bit obssessed by these semantics (might be because of my C++ background) but it seems important to clarify this. At least, deciding what semantics are used by default, at best, using a paragraph to describe it

Mixing up terminals and nonterminals

We need a production for cooked and pick "poached". That’s a nonterminal, so we add that. Now we’re back to the protein, so we add "eggs". We bounce back to breakfast and add "with". Now all that’s left is to pick a production for bread. We’ll pick "English muffin". That’s again a nonterminal, so we add that and we’re done:

Every single nonterminal should be terminal there.

1 != 2

In "The Lox Language", you have a code snippet where you say:
1 == 2; // true.
I thought you were joking for a minute, but the rest of the examples provided immediately afterwards are correct and don't have jokey answers.

Clarify associativity of double arithmetic

Section 6.1 has a side-note that says:

Ignoring issues around floating-point roundoff and overflow,
it doesn’t really matter whether you treat multiplication as
left- or right-associative — you’ll get the same result either
way. Division definitely does matter.

While this is a true statement, maybe the wording could be stronger to say that such things should not be ignored in practice? Properly programming floating-point arithmetic takes a certain amount of care. It is easy to come wth "surprising" examples. Like this one in jlox:

$ ./jlox 
> print(0.1 + (0.2 + 0.3));
0.6
> print((0.1 + 0.2) + 0.3);
0.6000000000000001
>

This side-note also might not be a bad place to refer folks to What Every Computer Scientist Should Know About Floating-Point Arithmetic.

typos(2) in introduction.md

design-notes 1.2.5 :

"I know a lot of language hackers who whose careers are based on this."

design-note: what's in a name? :

"One the hardest challenges in writing this book was coming up with a name for the language it implements."

Typo: chapter 2.3

This line in chapter 2.3 may need adjustment:

So go has a compiler, is an interpreter, and is also a compiler.

Also, I am by no means an expert on this field (that's why I am reading the book!), but is go really an interpreter, or is it the OS/CPU which actually interprets the go generated executable. Whereby the command, go run acts as a wrapper to compile, then start the interpretation which is done by the OS/CPU?

Anyway, thanks again for another great book!

Glossary of tech terms

A glossary of the technical terms used throughout the book would be useful. E.G. I had to go back to find what the acronym AST meant as it was only defined in the foot/sidenotes of the page.

Embedded runtimes

The sentence "In a fully compiled language, the code implementing the runtime gets inserted directly into the resulting executable." isn't what actually happens. Dynamic linking is used and space is saved.

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.