Dart: Google-backed programming language built to address issues in JavaScript

Dart Logo

I have to admit that this project pushes all of the right buttons for me. It looks like a fully structured language. It allows the use of types which opens the door for good tool support. It compiles down to JavaScript, so it will run in any browser. It can run on the server. Inheritance, generitc, isolates, annotations… I’m looking forward to building something in Dart.

From Wikipedia:

Dart is an open-source Web programming language developed by Google.

The goal of Dart is “ultimately to replace JavaScript as the lingua franca of web development on the open web platform”, but Dart currently relies
exclusively on its cross-compilation to JavaScript feature in order to run in mainstream browsers. Dart is intended to address issues with
JavaScript that Google engineers felt could not be solved by evolving the language, while offering better performance. Google works on Dart to help
it build more complex, full-featured client-side Web applications.
Dart is a class-based, single inheritance, object-oriented language with C-style syntax. It supports interfaces, abstract classes, reified
generics, and optional typing. Static type annotations do not affect the runtime semantics of the code. Instead, the type annotations can provide
documentation for tools like static checkers and dynamic run time checks.

From the Dart: Up and Running book on the Dart website:

Dart is easy to learn. A wide range of developers can learn Dart quickly. It’s an object-oriented language with classes, single inheritance,
lexical scope, top-level functions, and a familiar syntax. Most developers are up and running with Dart in just a few hours.

Dart compiles to JavaScript. Dart has been designed from the start to compile to JavaScript, so that Dart apps can run across the entire
modern web. Every feature considered for the language must somehow be translated to performant and logical JavaScript before it is added. Dart
draws a line in the sand and doesn’t support older, legacy browsers.

Dart runs in the client and on the server. The Dart virtual machine (VM) can be integrated into a web browser, but it can also run standalone
on the command line. With built-in library support for files, directories, sockets, and even web servers, you can use Dart for full end-to-end
apps.

Dart comes with a lightweight editor. You can use Dart Editor to write, launch, and debug Dart apps. The editor can help you with code
completion, detecting potential bugs, debugging both command-line and web apps, and even refactoring. Dart Editor isn’t required for writing
Dart; it’s just a tool that can help you write better code faster.

Dart supports types, without requiring them. You can omit types when you want to move very quickly, aren’t sure what structure to take, or
simply want to express something you can’t with the type system. You can add types as your program matures, the structure becomes more evident,
and more developers join the project. Dart’s optional types are static type annotations that act as documentation, clearly expressing your
intent. Using types means that fewer comments are required to document the code, and tools can give better warnings and error messages.

Dart scales from small scripts to large, complex apps. Web development is very much an iterative process. With the reload button acting as
your compiler, building the seed of a web app is often a fun experience of writing a few functions just to experiment. As the idea grows, you can
add more code and structure. Thanks to Dart’s support for top-level functions, optional types, classes, and libraries, your Dart programs can
start small and grow over time. Tools such as Dart Editor help you refactor and navigate your code as it evolves.

Dart has a wide array of built-in libraries. The core library supports built-in types and other fundamental features such as collections,
dates, and regular expressions. Web apps can use the HTML library—think DOM programming, but optimized for Dart. Command-line apps can use the
I/O library to work with files, directories, sockets, and servers. Other libraries include URI, UTF, Crypto, Math, and Unit test.

Dart supports safe, simple concurrency with isolates. Traditional shared-memory threads are difficult to debug and can lead to deadlocks.
Dart’s isolates, inspired by Erlang, provide an easier to understand model for running isolated, but concurrent, portions of your code. Spawning
new isolates is cheap and fast, and no state is shared.

Dart supports code sharing. Traditional web programming workflows can’t integrate third-party libraries from arbitrary sources or frameworks.
With the Dart package manager (pub) and language features such as libraries, you can easily discover, install, and integrate code from across the
web and enterprise.

Dart is open source. Dart was born for the web, and it’s available under a BSD-style license. You can find the project’s issue tracker and
source repository online. Maybe you’ll submit the next patch?

Web Appers: One of my go to sites for web development resources

Weappers screenshot

Web Appers is one of the sites I visit regularly to learn about new web development tools and resources.

The website says:

WebAppers is a blog dedicated to share top quality open source resources for web developer and web designer daily. As a web designer, you’ll find
some of the best free icons, stock photos, brushes, fonts and design inspirations. As a web developer, you’ll also find some of the best Javascript
and Ajax components like modal windows, menus, galleries, tooltips, charts, calendars plugins and a lot more …

Email to my wife’s cousin: Software development resources

One of my wife’s cousins is graduating from college in the spring, and she was offered a job doing software development. She called and we spoke about what it’s like to be a software developer day-to-day. When we were done talking she asked me if I had any resources I could share to help her get started with learning about Java development. Here’s what I sent her.


Hey Cuz!

Below are three books that might be of interest to you. I don’t expect you to read all three. Most developers are lucky to read one book a year. These are just suggestions of books you might want to know about. I’d start with Head First Java.

Also, I have listed several concepts you might want to be familiar with. DON’T FREAK OUT! I know it’s a lot of information. I don’t expect you to learn all of that stuff. Just skim it so that if someone says, “we deploy our application on Tomcat,” you will have seen the word “Tomcat” before.

I recommend that you download a copy of the Eclipse IDE, install it, and use it to work through some examples from Head First Java.

Feel free to reach out to me if you have any more questions. You can reach me at this email address or on my cell phone at [REDACTED SON!].

Good luck!

Books

Head First Java, 2nd Edition by Kathy Sierra

If you want to learn basic Java programming, this is where I would start.

Head First Java Cover


Effective Java (2nd Edition) by Joshua Bloch

This is my favorite Java book. I refer to it regularly. It’s the only one I have read cover to cover.

Effective Java Cover


Code Complete: A Practical Handbook of Software Construction, 2nd Edition by Steve McConnell

This book is more about programming in general. Pick up a copy from your library if you can and thumb through it. It might have some interesting stuff in it.

Code Complete Cover

Useful Website

Stack Overflow: http://stackoverflow.com/

This is the largest question and answer site for programmers. It is an invaluable resource if you have programming questions. Here’s a link to my Stack Overflow profile page if you want to see the kinds of questions a web developer might ask.

Concepts

Again, DON’T FREAK OUT! This is just a list of stuff an enterprise Java developer might work with. Just skim some of the web pages and familiarize yourself with some of the concepts if you have time.

StackOverflow: An invaluable tool in my developer toolbelt

stack-overflow-logo.png

It feels odd to even mention this site since I use it so often, but I still meet software developers who have never heard of Stack Overflow.

Stack Overflow is a question and answer site for professional and enthusiast programmers.” I’ve asked and answered a number of questions on the site, and it’s my go to place on the web when I have a software development or programming question of any kind. When I see Stack Overflow in my search results, it’s usually the link I click on first.

Here’s a link to my profile if you want to see the kinds of questions you can ask and get answers to.

Elixir: functional language built on the Erlang VM

Elixir logo

From the Elixir website (via Tim Bray’s blog) :

Elixir is a functional, meta-programming aware language built on top of the
Erlang VM. It is a dynamic language with flexible syntax and macro support that
leverages Erlang’s abilities to build concurrent, distributed and fault-tolerant
applications with hot code upgrades.

Elixir also provides first-class support for pattern matching, polymorphism via
protocols (similar to Clojure’s), aliases and associative data structures
(usually known as dicts or hashes in other programming languages).

Finally, Elixir and Erlang share the same bytecode and data types. This means
you can invoke Erlang code from Elixir (and vice-versa) without any conversion
or performance hit. This allows a developer to mix the expressiveness of Elixir
with the robustness and performance of Erlang.

DynJS: an ECMAScript (JavaScript) runtime for the JVM

From the DynJS website:

  • DynJS comes with a binary that you can use to execute Javascript files on the command line.
  • DynJS can be embedded into an existing Java application to provide JavaScript scripting abilities from your Java projects.

Command Line

$ ./bin/dynjs --help
Usage: dynjs [--console |--debug | --help | --version |FILE]
Starts the dynjs console or executes FILENAME depending the parameters

 FILE      : File to be executed by dynjs
 --console : Opens a REPL console to test small expressions.
 --debug   : Run REPL in debug mode.
 --help    : Shows current screen. Running without parameters also shows this.
 --version : Shows current dynjs version.

$ cat my_app.js
print("Hi! What's your name?");
var sayHello = function(name) {
    print("Hello " + name);
}

System = java.lang.System;
scanner = new java.util.Scanner(System.in);
name = scanner.nextLine();
sayHello(name);

$ ./bin/dynjs my_app.js
Hi! What's your name?
Douglas
Hello Douglas
^D

Embedding

import org.dynjs.Config;
import org.dynjs.exception.ThrowException;
import org.dynjs.runtime.*;

public class ScriptRunner {
  DynJS dynjs;
  Config config;

  public ScriptRunner() {
    config = new Config();
    dynjs  = new DynJS(config);
  }

  public Object runScript(String fileName) {
    Runner runner = dynjs.newRunner();
    return runner.withSource(new File(fileName)).execute();
  }

  public Object eval(String code) {
    return dynjs.evaluate(code);
  }

}

Vert.x: application server & framework designed for concurrency that supports mutiple languages on the JVM

From the Vert.x website:

Vert.x is a lightweight, high performance application platform for the JVM that’s designed for modern mobile, web, and enterprise applications.

  • Write your application components in Java, JavaScript, CoffeeScript, Ruby, Python or Groovy, or mix and match several programming languages in a
    single app.
  • Scales using messaging passing to efficiently utilise your server cores.
  • Uses non blocking I/O to serve many connections with minimal threads.
  • Simple actor-like concurrency model frees you from the pitfalls of traditional multi-threaded programming.
  • WebSockets and SockJS support for real-time server-push applications.
  • If you don’t want the whole platform, Vert.x can be embedded as a library in your existing Java applications.
  • 100% open source. Licensed under the Apache Software License 2.0

I like the fact that I can embed it in my app running on the app server of my choice. It also seems to offer lots of flexibility in its concurrnency model. I’m going to poke around to see if I can find examples of medium to large applications running on Vert.x.

Everything Search: A fast and easy Windows file finder

Everything Search screenshot

Everything Search is one of my favorite freeware Windows tools. It watches the filesystem journal for changes, making it very fast and up-to-date in nearly real time.

From the website:

“Everything” is an administrative tool that locates files and folders by filename instantly for Windows.
Unlike Windows search “Everything” initially displays every file and folder on your computer (hence the name “Everything”).
You type in a search filter to limit what files and folders are displayed.

  • Small installation file
  • Clean and simple user interface
  • Quick file indexing
  • Quick searching
  • Minimal resource usage
  • Share files with others easily
  • Real-time updating