www.dpdl.io
developed by SEE Solutions © 2003
More advanced sample applications written with Dpdl that serve as demonstrators are published in this repository:
These examples are demonstrators but are full running applications.
-
Example Dpdl Code with Array definition, population and access using an 'Iterator'
-
Example Dpdl code that makes use of the type 'class'
-
Example Dpdl code that makes use of derived type 'class' (Inheritance and Polymorphism). Some functions make use of embedded code (java and C)
-
Example Dpdl code that makes use of the type 'struct'
-
Dynamic Array definition, population and access
-
Example Dpdl code that loads and accesses natively the 'libc' shared library functions
-
Example Dpdl code that writes and reads a data buffer to a file using the native library functions in 'libc'
-
Example Dpdl code that shows how exceptions can be raised and handled
-
Example Dpdl code that shows how to initialize a 'class' type with constructor, and without constructor
-
Example Dpdl code that shows how to initialize 'struct' member variables upon declaration
-
Example Dpdl code that uses vec(...), map(...), list(...) and stack(...) data functions
-
Example Dpdl code that make use of the 'typedef' specifier
-
Example Dpdl code that launches multiple threads
-
Example Dpdl code that make use of the
>>task
keyword to execute embedded Dpdl code sections asynchronously -
Load a Dpdl script object "LoadCodeFunc.h" via 'loadCode(..)' and call one of its functions
-
Embedding and executing structured code resources
-
Example Dpdl code that makes use of pointers and references
-
Example Dpdl code that updates the fields of a struct type via a dedicated thread
-
Inline execution of Dpdl code
-
Example Dpdl code (dummy) that shows some functionalities of Dpdl
-
Example Dpdl code that shows how C code and Java can be embedded and executed within Dpdl
-
Execute a Dpdl script continuously in a dedicated Thread instance
-
Uses the Dpdl API library DoubleEmul and FloatEmul to emulate floating point and double precision math operations
-
Example Dpdl code that converts/compiles a 'struct' to a native java bytecode object and accesses member variables and methods
-
Example program written in C that shows how to execute a given Dpdl script from C code
-
Example program written in C that shows how to execute embedded Dpdl code within C code
-
Example Dpdl code that parses an XML document with the xml pull parser
-
Parse JSON file and access data types
-
Parse JSON file and decode data into a struct
-
Example Dpdl code that performs HTTP requests (GET, POST and PUT)
-
Example Dpdl code that makes use of multi-line structured text resources
-
Example Dpdl code that compresses and de-compresses a string of data using the Java platform API
-
Example Dpdl code that embeds and executed an SQL query on a defined database and retrieves and prints out the result
-
Example Dpdl code that embeds and executed an SQL query on a defined database and retrieves and prints out the result (same as above), and encodes the result set into a json string, than decodes the json string to an object that can be accessed
-
Save and access data from a record store
-
Test read and write access to record stores
-
Simple console application to allocate and perform queries on the supplied DpdlPacket dpdl_PHONEBOOK. The script allows to perform single queries, or n sequential or random queries, and measures the execution time. Comment or uncomment the following line of code in the script -> i #abs(search_rand_int)
-
Dpdl code that shows how to read and write data to a virtual record store filesystem
The following Dpdl examples show how to exploit capabilities of a GPU via embedded 'Wgsl' and 'OCL' code sections
-
Dpdl sample code that makes use of the Dpdl language plug-in 'dpdlopencl' to execute embedded OCL code (OpenCL)
-
Example Dpdl code that make use of Wgsl (WebGPU shading language) to speed-up computations for a high-performing neural network activation function (GELU) directly on GPUs
The following examples make use of the Dpdl langage plugin 'DpdlAINerd (DAN)' to automatically generate embedded code sections in various programming languages within Dpdl which can than be executed right away on the DpdlEngine.
-
Example Dpdl code that makes use of the Dpdl language plugin 'DpdlAINerd' (DAN) to automatically generate a simple SNAKE Game console application (written in C) via AI generative code using DeepSeek AI Models.
The code is generated, compiled and executed in a single step
The code above 'ai/dpdlAISnakeGame.h' automatically generated the following Dpdl code with embedded C: ai/dpdlAISnakeGame_gen.h
The AI engine used in this case was the available 'DeepSeek' model. No adaptations were needed to successfully run the program right away.
-
Example Dpdl code that leverages generative AI using the 'DpdlAINerd' (DAN) Dpdl language plug-in to generate embedded code sections which can than be executed
The code above automatically generated the following Dpdl code: ai/dpdlAICodeSort_gen.h
-
Example Dpdl code that leverages AI using the 'DpdlAINerd' (DAN) Dpdl language plug-in to generate a json test dataset
-
Example Dpdl code that leverages AI using the 'DpdlAINerd' (DAN) Dpdl language plug-in to generate and execute embedded code right away
this program Output:
this is my sample json:
{
"documentType": "National ID",
"issuingCountry": "United States",
"issuingAuthority": "Department of Motor Vehicles",
"documentNumber": "123456789",
"issueDate": "2020-05-15",
"expiryDate": "2030-05-15",
"personalDetails": {
"firstName": "John",
"middleName": "Michael",
"lastName": "Doe",
"dateOfBirth": "1985-07-20",
"gender": "Male",
"placeOfBirth": "New York, USA",
"nationality": "American"
},
"address": {
"street": "123 Main St",
"city": "New York",
"state": "NY",
"postalCode": "10001",
"country": "USA"
},
"biometricData": {
"photo": "base64EncodedPhotoString",
"signature": "base64EncodedSignatureString",
"fingerprints": {
"leftThumb": "base64EncodedFingerprint",
"rightThumb": "base64EncodedFingerprint"
}
},
"additionalInformation": {
"height": "180 cm",
"eyeColor": "Brown",
"bloodType": "O+",
"organDonor": true
},
"securityFeatures": {
"barcode": "base64EncodedBarcode",
"mrz": "P<USADOE<<JOHN<MICHAEL<<<<<<<<<<<<<<<<<<<<<<<1234567890USA8507201M3005159<<<<<<<<<<<<<<02",
"chip": {
"encryptedData": "base64EncodedEncryptedData",
"publicKey": "base64EncodedPublicKey"
}
}
}
-
Example Dpdl app that uses the JavaFX java library to create a sample UI (Graphical User Interface) application via a FXML definition and used CSS to create the layout.
-
Example Dpdl code that uses the JavaFX java library to render UI (Graphical User Interface) elements via a FXML definition.
-
Drawing functions on a UI Canvas on J2ME devices
-
Creates a graphical user interface with some UI components (Button, Panel, Checkbox, List, draw Panel) using Java Swing classes. The list is updated, the button command is intercepted with the 'actionPerformed' function, the checkbox status is printed to stdout, and a text and rectangle is drawn at random location on the draw panel using a thread.
-
Example Dpdl code that downloads json news data from a given URL and decodes it to a struct
-
Implementation of SHA-1 hash algorithm entirely written in Dpdl
-
Example Dpdl app that uses the JavaFX library to render and animate a 3D model of a chemical molecule (hydrogen)
graphics/dpdl3DJavaFX_molecule.h
-
Example Dpdl code that executes an embedded 'clojure' code that creates a simple UI to convert values from Celsius to Fahrenheit
clj/dpdlCljCelsiusConverterGUI.h
-
Example Dpdl code that executes an embedded 'Julia' script to plot data using the 'Plots' package, and to save the chart as PDF
here the exported PDF:
-
Example Dpdl app that uses the JavaFX java library to visualize a website within a WebView component
-
Performs a discovery of bluetooth devices and saves the device addresses discovered in a record store
-
Downloads a html website from a URL and saves the content in a local file
-
Accepts connections from a bluetooth server application and intercepts commands
-
BTObexServer (client/server)
Sample application that implements sending of SMS via bluetooth to discovered devices. The messages to be sent are read from a record store. An auxiliary script (ImportantMsgWriter.h) can be used to store messages to be delivered in the record store
-
HTTPServer:
Simple client server application to send and receive broadcasted messages via HTTP protocol.
How to run:
1) start the server: HTTPServer/HTTPServer.h 2) start the 1st client: HTTPServer/HTTPClient.h 3) start the 2nd client, but first change the CLIENT_ID in the HTTPClient.h script
-
CoAP (client/server):
Client server application that implements PUT, GET, OBSERVE requests via CoAP (Constrained Application Protocol). The clients can create resources and perform PUT, GET or OBSERVE requests on the resources created.
Once the dpdlCoAPServer.h is started, the observe client (dpdlCoAPClient.h) can be initialized in a 2nd console, and a second client (dpdlCoAPClient2.h) that performs PUT requests can be initialized in a 3rd console by starting it in a dedicated thread via the script 'startClientThread.h'
How to run:
1) start the server: CoAP/dpdlCoAPServer.h 2) start the 1st client: CoAP/dpdlCoAPClient.h 3) start the 2nd client in a thread instance: CoAP/startClientThread.h
-
Example with embedded C code execution within Dpdl (interpreted Mode 1)
-
Example with embedded C code execution within Dpdl that is compiled in memory at runtime (compiled Mode 1)
-
Example Dpdl code that shows how C code and Python can be embedded and executed within Dpdl
-
Example Dpdl code that shows how MicroPython code can be embedded and executed within Dpdl. MicroPython is suitable for embedded systems.
-
Example Dpdl code that makes use of an embedded Java code block to perform a dummy calculation on an array passed from Dpdl
-
Embedded C code execution within Dpdl code
-
Embedded Python code execution within Dpdl code
-
Embedded Lua code execution within Dpdl code
-
Embedded Ruby code execution within Dpdl code
-
Embedded V code execution within Dpdl code (fibonacci sequence)
-
Example Dpdl code that embeds C++ code and uses ROOT API libraries to solve a linear equations in 4 different ways
-
Example Dpdl code that embeds javascript code (with Mode2 using 'qjs') that loads an object implemented in a native C library (see point.c)
-
Example Dpdl code that compiles a WebAssembly WAT code to WASM binary format and calls the exported functions from both, Dpdl and javascript
-
Dpdl code that compiles two WebAssembly modules (in WAT code), with 1st module that exports functions to the 2nd module, to WASM binary format. The function 'add_and_sub' exported by the 2nd module is than called from Dpdl
-
Example Dpdl code with embedded ANSI C code that is compiled in memory and executed at runtime, the result is than intercepted
-
Example Dpdl code that executes an embedded 'Julia' script to download data via HTTP via url's contained in json data
-
Example Dpdl code that executes an embedded 'groovy' code (dummy)
-
Example Dpdl code embedding ANSI C code (ISO C99) that is dynamically compiled in memory at runtime (fast) and executed
-
Example Dpdl code that embeds JavaScript that intercepts some parameters that have been pushed on the dpdl stack
-
Example Dpdl code that embeds Clojure code
-
Example Dpdl code (embedded C code compiled at runtime) that launches threads (pThreads) to sum numbers
-
Example Dpdl code that shows to to execute embedded C code accepting parameters pushed on the dpdl_stack, and writes some result back to a buffer variable. The execution time is measured.
-
Example Dpdl code that embeds 'Julia' code to execute a set of threads that call a native C Dpdl API function
-
Example Dpdl code that embeds 'PHP' code to read a CSV file, count the number of fields in each line and print the values
-
Simple benchmark to measure the execution speed of Dpdl function calls with access to JRE objects
-
Simple benchmark to measure the execution speed of different embedded code sections including Dpdl, Java, C (interpreted), C (compiled), JavaScript and Clojure
-
Simple benchmark to measure the execution speed of 'struct' function calls (with embedded Java code), compiled and executed with java bytecode
-
Simple benchmark to measure the execution speed of embedded javascript executed within a dedicated dpdl thread
-
Simple test that executes some 'task' asynchronously
-
Simple benchmark that makes use of 'class'
-
Small 'dummy' sample application
-
Set of 14 examples/tests. The examples make use of @TAG execution to allow execution of each individual example.
-load dpdlLibExamples.h @TEST1 -load dpdlLibExamples.h @TEST2 etc.. ....
The Dpdl example scripts are located in the './DpdlLibs/' folder and can be executed in different ways:
- or directly via the '-load' parameter at startup
- using the
DpdlClient
console application with commands - or using the API function call DPDLAPI_execCode(..).
The script path per default configuration need to be relative to the './DpdlLibs/' folder
java --add-opens java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-opens java.base/sun.net.www.protocol.https=ALL-UNNAMED -jar DpdlEngine_V1.0_release.jar -load test/testArray.h
Note: On newer versions of java (from Oracle), in order to access specific java 'modules' within Dpdl, you may need to enable them with the option '--add-opens'
-load
enter the Dpdl script name to execute:
arraylistExample.h [@TEST1]
println("executing dpdl script...")
int s = DPDLAPI_execCode("mydpdlscript.h")
println("status: " + s)
The Dpdl sample scripts and Dpdl sample applications published on this repository are released under the MIT License.