import ballerina/graphql;
import ballerina/http;
import ballerinax/mysql;
import ballerinax/mysql.driver as _;
configurable string user = ?;
configurable string password = ?;
configurable string host = ?;
configurable int port = ?;
configurable string database = ?;
configurable string apiEndpoint = ?;
public type Album record {
string id;
string title;
string artist;
decimal price;
Currency currency = USD;
};
public enum Currency {
USD,
LKR,
EUR,
GBP
}
service / on new graphql:Listener(9000) {
private final mysql:Client db;
private final http:Client forex;
private final Currency baseCurrency = USD;
function init() returns error? {
self.db = check new (host, user, password, database, port);
self.forex = check new (apiEndpoint);
}
resource function get album(string id, Currency currency = USD) returns Album|error {
Album album = check self.db->queryRow(`SELECT * FROM Albums WHERE id=${id}`);
if currency != self.baseCurrency {
string query = string `from=${self.baseCurrency}&to=${currency}`;
record {decimal rate;} exchange = check self.forex->get(string `/curerncyConversion?${query}`);
album.price = album.price * exchange.rate;
album.currency = currency;
}
return album;
}
}
Overview of Programming Languages (used in our RnD)
C# is a general-purpose, multi-paradigm programming language.
C# encompasses static typing, strong typing, lexically scoped,
imperative, declarative, functional, generic, object-oriented,
and component-oriented programming disciplines.
https://dotnet.microsoft.com/en-us/languages/csharp
Java is a high-level, class-based, object-oriented programming language
that is designed to have as few implementation dependencies as possible.
It is a general-purpose programming language intended to let programmers write once,
run anywhere, meaning that compiled Java code can run on all platforms
that support Java without the need to recompile.
Wikipedia
https://dotnet.microsoft.com/en-us/languages/csharp
"C++ (pronounced cee plus plus) is a general-purpose programming language.
It has imperative, object oriented and generic programming features,
while also providing facilities for low-level memory manipulation."
-- Wikipedia.org/C++
http://www.cplusplus.org/
Ada is a modern programming language designed for large, long-lived applications
– and embedded systems in particular – where safety and security are essential.
Ada is a structured, statically typed, imperative, and object-oriented high-level programming language, extended from Pascal and other languages.
It has built-in language support for design by contract, extremely strong typing, explicit concurrency, tasks, synchronous message passing, protected objects, and non-determinism.
Wikipedia
Paradigm:Multi-paradigm: structured, imperative, object-oriented, aspect-oriented, concurrent, array, distributed, generic, procedural, meta
https://www.adaic.org
Assembler
In computer programming, assembly language, often referred to simply as Assembly
and commonly abbreviated as ASM or asm, is any low-level programming language
with a very strong correspondence between the instructions in the language
and the architecture's machine code instructions.
Wikipedia
Tcl
Tcl is a high-level, general-purpose, interpreted, dynamic programming language.
It was designed with the goal of being very simple but powerful.
Tcl casts everything into the mold of a command, even programming constructs like variable assignment and procedure definition.
www.tcl.tk/
Python is an easy-to-learn, powerful programming language.
It has efficient high-level data structures and a simple but effective approach to object-oriented programming.
www.python.org
Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages.
www.perl.org
Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.
nodejs.org
Julia is a high-level, high-performance, dynamic programming language.
While it is a general-purpose language and can be used to write any application,
many of its features are well suited for numerical analysis and computational science.
julialang.org/
Ruby is...
A dynamic, open source programming language with a focus on simplicity and productivity.
It has an elegant syntax that is natural to read and easy to write.
www.ruby-lang.org
MATLAB is a numerical analysis environment as well as a fourth-generation computer programming language.
Matlab is considered as a matrix laboratory which is known as a language used for technical computing.
Matlab was written in C, C++, as well as Java.
Note: Currently most of our matlab related research is done using Octave.
https://de.mathworks.com/products/matlab.html
https://de.mathworks.com/products/matlab-online.html
Octave is considered as a high-level interpreted programming language that is used for numerical computations.
It is also an operationally critical threat, asset as well as vulnerability evaluation.
https://octave.org/
The Wolfram Language is a general multi-paradigm programming language developed by Wolfram Research.
It emphasizes symbolic computation, functional programming, and rule-based programming and can employ arbitrary structures and data.
It is the programming language of the mathematical symbolic computation program Mathematica.
https://www.wolfram.com/language/
Maple is a symbolic and numeric computing environment as well as a multi-paradigm programming language.
It covers several areas of technical computing, such as symbolic mathematics, numerical analysis, data processing, visualization, and others.
https://www.maplesoft.com/support/help/Maple/view.aspx?path=ProgrammingGuide/Chapter01
The Modelica Language is a language for modeling of cyber-physical systems,
supporting acausal connection of components governed by mathematical equations to facilitate modeling from first principles.
It provides object-oriented constructs that facilitate reuse of models, and can be used conveniently
for modeling complex systems containing, e.g., mechanical, electrical, electronic, magnetic, hydraulic, thermal, control, electric power or process-oriented subcomponents.
https://modelica.org/modelicalanguage.html
www.openmodelica.org
Ballerina is an open-source programming language for the cloud that makes it easier to use, combine, and create network services.
/ballerina.io
Nim is a statically typed compiled systems programming language.
It combines successful concepts from mature languages like Python, Ada and Modula.
nim-lang.org/
import std/parsecfg
import std/[strutils, streams]
let configFile = "example.ini"
var f = newFileStream(configFile, fmRead)
assert f != nil, "cannot open " & configFile
var p: CfgParser
open(p, f, configFile)
while true:
var e = next(p)
case e.kind
of cfgEof: break
of cfgSectionStart: ## a `` has been parsed
echo "new section: " & e.section
of cfgKeyValuePair:
echo "key-value-pair: " & e.key & ": " & e.value
of cfgOption:
echo "command: " & e.key & ": " & e.value
of cfgError:
echo e.msg
close(p)
Io is a programming language focused on expressiveness through simplicity.
iolanguage.org
#!/usr/bin/env io
/* The Computer Language Shootout
http://shootout.alioth.debian.org
Contributed by Ian Osgood, Steve Dekorte */
Vector := Sequence clone setItemType("float32") setEncoding("number")
MandelbrotSet := Object clone do(
max_iterations := 50
limit := 2 squared
dim := 200
org_r := -1.5
org_i := -1
ext_r := 2
ext_i := 2
calc := method(
cr := Vector clone setSize(dim squared)
ci := Vector clone setSize(dim squared)
size := 0
for(y, 0, dim-1,
Ci := ((y * ext_i / dim) + org_i)
for(x, 0, dim-1,
Cr := ((x * ext_r / dim) + org_r)
cr atPut(size, Cr)
ci atPut(size, Ci)
size = size + 1
)
)
zr := cr clone
zi := ci clone
zr2 := Vector clone setSize(size)
zi2 := Vector clone setSize(size)
temp := Vector clone setSize(size)
max_iterations repeat(
temp copy(zr) *= zi
zr2 copy(zr) square
zi2 copy(zi) square
zr copy(zr2) -= zi2 += cr
zi copy(temp) *= 2 += ci
)
self result := zi2 + zr2
)
printSet := method(
writeln("P4\n", dim, " ", dim)
out := File standardOutput
i := 0
dim repeat(
(dim / 8) repeat(
pixel := 0
8 repeat(
pixel = pixel shiftLeft(1)
if (limit > result at(i), pixel = pixel | 1)
i = i + 1
)
out write(pixel asCharacter)
)
/* if (dim%8!=0, ) */
)
)
printSet := method(
writeln("P4\n", dim, " ", dim)
out := File standardOutput
i := 0
dim repeat(
(dim / 8) repeat(
pixel := 0
8 repeat(
pixel = pixel shiftLeft(1)
if (result at(i) < limit, pixel = pixel | 1)
i = i + 1
)
out write(pixel asCharacter)
)
/* if (dim%8!=0, ) */
)
)
)
MandelbrotSet dim := System args at(1) asNumber
MandelbrotSet do( calc; printSet )
A language for humans and computers
Crystal’s syntax is heavily inspired by Ruby’s, so it feels natural to read and easy to write,
and has the added benefit of a lower learning curve for experienced Ruby devs.
Crystal is statically type checked, so any type errors will be caught early by the compiler rather than fail on runtime.
Moreover, and to keep the language clean, Crystal has built-in type inference, so most type annotations are unneeded.
https://crystal-lang.org/
CUDA is a parallel computing and programming platform introduced by NVIDIA for general computing of GPUs.
It helps developers speed up computing applications by leveraging the potential of GPUs.
The CUDA Toolkit has everything you need for creating GPU-accelerated applications in popular languages like
C, C++, Python, MATLAB, Fortran, etc.
https://developer.nvidia.com/cuda-zone
A Software Framework for Neuromorphic Computing
Lava is an open source SW framework to develop applications for neuromorphic hardware architectures.
It provides developers with the abstractions and tools to develop distributed and massively parallel applications.
These applications can be deployed to heterogeneous system architectures containing conventional processors
as well as neuromorphic chips that exploit event-based message passing for communication.
The Lava framework comprises high-level libraries for deep learning, constrained optimization, and others for productive algorithm development.
It also includes tools to map those algorithms to different types of hardware architectures.
https://github.com/lava-nc
https://github.com/lava-nc/lava
Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design.
Built by experienced developers, it takes care of much of the hassle of web development,
so you can focus on writing your app without needing to reinvent the wheel.
It's free and open source. Ridiculously fast.
https://djangoproject.com
PLY
PLY is a pure-Python implementation of the compiler construction tools lex and yacc.
The main goal of PLY is to stay fairly faithful to the way in which traditional lex/yacc tools work.
This includes supporting LALR (1) parsing as well as providing extensive input validation, error reporting, and diagnostics.
http://www.dabeaz.com/ply/
Create production-grade machine learning models
TensorFlow is an end-to-end open source platform for machine learning.
It has a comprehensive, flexible ecosystem of tools, libraries and community resources
that lets researchers push the state-of-the-art in ML and developers easily build and deploy ML powered applications.
https://www.tensorflow.org/
Sinumerik
SINUMERIK ONE is the digital native, future-proof CNC system for highly productive machine tools.
For unimagined new possibilities, ideas and business models;
for faster innovations through the seamless interaction of virtual sphere and real world
SINUMERIK ONE is much more than a powerful hardware innovation.
https://new.siemens.com/us/en/products/automation/systems/cnc-sinumerik.html
The TNC7 combines familiar Klartext programming with newly developed graphical programming,
a customizable user interface and smart functions.
Easy creation of NC programs using KLARTEXT HEIDENHAIN controls
are workshop oriented, which means that they were conceived for programming right at the machine.
With conversational programming you can forget about memorizing G codes.
The MillPlus was a control designed exclusively for DMG.
For this reason, DMG is responsible for answering questions about the MillPlus.
https://news.heidenhain.com/machine-tool/tnc7
picture copyright Heidenhain
Boosting the widest range of CNC systems in the industry,
FANUC provides everything you will ever need for your CNC
from best value controls with powerful functionality
to high-performance control systems for complex machines.
Controls, motors and amplifiers, cables and connectors come in
easy-to-install packages tailored to your specific needs.
Quick to program and easy to use, they guarantee maximum quality and short cycle times.
picture copyright Fanuc
https://www.fanuc.eu
Röders provides their own highly flexible high level nc language for their RMS6 controllers.
Röders RMS language is made for parametric development with a focus on HSM and HSC.
picture copyright Röders
https://roeders.de/
Datron provides a highly flexible high level nc programming language.
Commandnames are speaking language dependent.
Datron language is made for parametric development
and can be mixed with a Fanuc like interpreted syntax.
Like Röders Datron is specialised in HSM and HSC.
https://www.datron.com
picture copyright Datron