Skip to content

Instantly share code, notes, and snippets.

@mrsimpson
Last active April 22, 2020 10:15
Show Gist options
  • Save mrsimpson/73c4e0368195fca9e14cd0f7223fead6 to your computer and use it in GitHub Desktop.
Save mrsimpson/73c4e0368195fca9e14cd0f7223fead6 to your computer and use it in GitHub Desktop.
Open ABAP Runtime

An open source ABAP runtime

This gist holds ideas and artifacts related to creating a runtime for ABAP code - which runs without an ABAP application server, leveraging only OpenSource tools and good practices from the web dev community.

td;dr - what should be achieved

Code logic in a (limited scope of) ABAP.
Transpile ABAP to a script language (most probably Javascript).
Use a containerized runtime which allows to execute this on a server.

Motivation

ABAP is a great programming language. If you want to argue, feel free to. I don't mind, everybody's free to have their opinions. Thankfully, in this case, the one-and-only Josh Marinacci aleady pharased it better than I can

Programming languages are user interfaces for programmers, not the computer. They let the programmers express what they want it the most convenient way possible and have the compiler talk to the computer.

The quite unique natural language oriented design of the language led to business people being able to code (some only "sort-of", to be honest). And this is a blessing: They were able to turn business knowledge into executable code with a minimal representational gap. As SAP speeds towards modern and complex technologies, there's a danger that while embracing the latest funky new hot shit technology, we not only lose the language - but along with it lose the unique domain knowledge those programmers have acquired in years and years.

If we want to save us all from re-learning the (most incredibly boring illogical business processes, we need to preserve the domain experts' capabilities to code - and this means to save ABAP.

Architecture

Based upon the current (Feb 2020) hypes and particularly not-so-hot-anymore hypes, an opinionated toolset shall be designed. The AS ABAP has always been a (very) opinionated framework - with an absolute focus on integration and developer experience.

Principle: Integration

An architecture aiming at leveraging the non-coders to produce executable code includes an environment in which they should not need to lear about the internals of each components. There should be a paved way for code-to-production which is frictionless - at least for the exceptionless case.

Principle: Open Source

In order to being able to scale, all components which are needed for for code-to-production need to be licensed in such a way that they can be utilized easily in corporate environments. Apache License or MIT license are preferred. Ideally, use established products from bigger communities / organizations, such as the Cloud Native Computing Foundation (CNCF) or the Apache Software Foundation.

Principle: Build for cloud

All tools involved need to be able to run in a cloud native environment, which can be easily set-up free of charge, on all stages from development (developers' laptop) to production (computercenter / cloud provider). All vendor specific (proprietary) tool shall be avoided to prevent another vendor lock-in.

Tools involved

By the time of writing , the following tools seem to be a good start for such an effort.

Programming language:

ABAP Parsing

ABAPLint has already covered a large chunk of ABAP statements, enabling it to create an abstract syntax tree.

Javascript

Why JS?

  • Very low delay on execution
  • High performance
  • Open tooling for IDE, transpiling, linting, runtimes
  • Huge catalogue of libraries
  • Not limited to the server

MISSING: Transpiler

The missing link: Make ABAP code executable as Javascript. This is probably a hard part due to the side-effect-heavy ABAP language. But: When focusing on what's needed for implementing stateless functions, this should could be managable. Also the tooling for the actual transpiling does not have to be re-invented: Babel provides an extensible infrastructure for making code executable in Javascrit. This includes Source maps support which is important with respect to debugging later-on. See Babel's API for an idea how to start with an AST.

Kubernetes (k8s)

Kubernetes is eating the world datacenters

  • Huge community with top-contributors (Google, AWS, Azure)
  • CNCF
  • High portability

OpenFaaS

OpenFaaS provides a language agnostic framework for running functions on a container. Templating system allows to scaffold easily while preserving exchangability of components.

=> utilize the Plonk-Stack to hide K8S complexity

=> utilize OpenFaad cloud, possibly integrated with GitLab to provide an open equivalent of the transport managament system

@octavonu
Copy link

This would be a very interesting project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment