Coder Social home page Coder Social logo

sham-kotlin's Introduction

simplified-hypothetical-alphanumeric-machine

A project dedicated to the memory of James Maginnis, a 30 year computer Science professor at Drexel University.

Professor Maginnis created SHAM as the primary teaching tool for the Operating Systems course. This course was required for Computer Science majors in the late 1980s.

The SHAM system consisted of two applications. The first was the SHAM computer. On start-up, this application would read contents a file, "sham.rom". sham.rom consisted of machine code that was read into "RAM", registers initialized, and execution machine code started. The rom file was the kernel of the operating system. The second application was the assembler. Professor Maginnis created his own machine code and assembly language. The assembler, as expected, read in the source code file and generated (primarily) the sham.rom.

The SHAM computer and assembly language were uniquely crafted to address the fundamentals in course that lasted 10 weeks. (Drexel has 4 terms per academic year. Each term consists of 11 weeks; 10 weeks of instruction, 1 week of finals.) The SHAM computer lacked many capabilities of modern CPUs: no floating point operations, integer (short) math only, no mod operator, no bit operators. However, it did include operators that don't exist on any chip. Opcodes were included that could: read character from keyboard, write character to screen, stream 256 bytes to/from a file.

The SHAM system was written to run on the original Macintosh® platform. (https://en.wikipedia.org/wiki/Macintosh_128K) That platform ran at 7.8336 MHz. Granted, that was 30+ years ago, but I recall that both the computer and assembler ran quickly enough to be comfortable to use. Less than a minute for the assembler. Can't swear to the language he used for both, but I'm reasonably sure he used C. The SHAM user manual included < 20 SLOC of C to give us insight into the "host" computer.

As an undergrad student, I was impressed by the computer and assembler. Another anecdote cements that in my mind. My fellow students and I were probably using the basic text editor that came on the Mac OS floppies. Some may have gotten hold of a different one, as we were discussing the merits of the options. In one class, we asked Professor Maginnis what editor he used. In an offhand manner, he told us that he had written his own. That fits well with his creation of SHAM.

March of this year (2019) I found the handouts and notes from my OS class. The discovery ignited my "scratch an itch" that is so common in the open source world. As much as I respect C, I'm out of practice and did not want to research standard libraries, research other libraries, or deal with low level details. I had some professional experience with Scala; originally chose that language for implementation. But, even though Scala is a better Java, it sometimes requires explicit declarations and conversions. I decided to implement in Clojure. I'm one of those to whom Lisp has an appeal. It suits my way of thinking. It meshes well with my editor of choice: emacs. I've extended my emacs considerably, making it my personal writing environment. As emacs consists of its own brand of Lisp, I've had to learn key concepts to code my extensions. Also, I've taken this quote, from Eric S. Raymond (How To Be a Hacker; http://www.catb.org/~esr/faqs/hacker-howto.html) to heart.

"LISP is worth learning for a different reason — the profound
enlightenment experience you will have when you finally get it.
That experience will make you a better programmer for the rest of
your days, even if you never actually use LISP itself a lot. (You
can get some beginning experience with LISP fairly easily by
writing and modifying editing modes for the Emacs text editor, or
Script-Fu plugins for the GIMP.)"

UPDATE:

I am now implementing SHAM in Kotlin. I also want to expand my skill-set to include possible Android development. Java is out of the question due to all the boilerplate. Also, having had functional programming experience, the clunky "everything is an object" environment is not something I want wade into.

Unfortunately at this time (Aug 23, 2020) I have not found emacs extensions that provide the same kind of editing power in Kotlin that is available for Scala and Clojure. Since Kotlin is the brainchild of JetBrains, I will shift much of my development work to IntelliJ IDEA. I'll also do some parallel work with emacs. I've added my own extension to that editor that don't exist in any other product. It's faster to use two editors than for me to learn how to write my own IntelliJ plugins.

sham-kotlin's People

Contributors

mark-naylor-1701 avatar

Watchers

James Cloos avatar  avatar

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.