Hopper is a modern semi-colon and curly brace language designed for small platforms like microcontrollers and the 6502. It has reference types like strings, lists and dictionaries and a managed heap (garbage collection). It is a bit like C# or Java but without classes.
This is an instructional project explaining how to get the development environment up and running on Windows. The entire environment (shell, editor, etc) and toolchain (compiler, disassembler, debugger, etc) are all written in Hopper.
I'll do further instructional projects to explain the next step: getting up and running on your small device (Raspberry Pi Pico, for example) but you need a desktop Hopper environement to do that (and Windows is the only currently available one).
Repo on GitHubThe public repo on GitHub can be found here:
https://github.com/sillycowvalley/Hopper
Start by cloning this repo to any location on your Windows machine. For example:
Hopper has its own shell and, once in this shell, this location is considered the root folder of the known Hopper universe:
Included in the repo is a set of pre-built binaries. Only one of these is an actual Windows binary and this is the Windows.NET runtime for Hopper, written in C:
All the others have a .hexe
extension which means they are Hopper 'binaries' that can only run in a Hopper runtime.
You can either run this pre-built HopperNET.exe
or you can build it yourself from the source using Visual Studio Community Edition. The source project for HopperNET can be found under the /Runtimes
folder:
Once you have HopperNET built (or if you choose to run the pre-built one), just run the EXE and you should see the Hopper shell window. You don't have a choice about running the prebuilt.hexe 'binaries' because Hopper is self-hosted: you need them to build them. ;-)
The shell is actually one of the.hexe binaries (shell.hexe
) and the dir
command is dir.hexe
, etc.
You don't need to do this but you can. Good to know if you want to start making modifications. Hopper has the equivalent of batch files or console scripts and they have the extension .cmd
There are two scripts included in the /Bin
folder: tools.cmd
and sys.cmd
tools.cmd
will rebuild the compiler toolchain (preprocessor, compiler, optimizer, code generator and disassembler).
sys.cmd
will rebuild the shell tools (like the shell
itself, dir
, etc) and the non-toolchain tools (like the editor and the debugger).
The Hopper repo includes a /Source
folder. All Hopper source on the planet is included under this folder. This includes interesting Hopper projects like the compiler, the optimizer, the debugger and the editor/IDE.
There is also a /Source/Samples
folder:
Note: paths in the Hopper environment are not case sensitive. Rules for paths and filenames differ from what you are familiar with though, for example, spaces are illegal in both file and folder names. There is a PDF in the repo that summarizes some of the ways Hopper and the environment may differ from what you'd expect:Hopper Language
<F7>
to build. If you <Ctrl><F5>
to run, your screen will flicker briefly because this sample exits on completion. Rather <Alt><F4>
to exit the IDE and then run from the console by typing mandelbrot
.
The IDE outputs the binaries you build to the /Bin
folder. The shell looks for binaries or scripts first in the current folder and failing that, looks in the /Bin
folder. That's how it finds the mandelbrot.hexe
that you just built.
My YouTube channel has the following playlists:
Hopper Language : introductory tutorial style videos walking through and explaining features of the Hopper language. Applies to Hopper on all platforms.
Hopper on Microcontrollers : demonstrations of Hopper runinng on microcontrollers, mostly on the Raspberry Pi Pico.
Hopper Internals : longer and more in-depth videos describing what's under the hood, why things are the way they are, and how it was made.
Hopper on 6502 : a modern semicolon and curly brace language with garbage collected heap running on an 8 bit CPU!
Subscribe to the YouTube channel and/or follow me on Hackster to get the latest developments. There is a lot still to be done and this way you'll know when key milestones are hit.
Comments