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 that 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 downloads json news data and decodes it to a struct
-
Example Dpdl code that loads and accesses natively the 'libc' system library functions
-
Example Dpdl app that uses the JavaFX library to render and animate a 3D model of a chemical molecule (hydrogen)
graphics/dpdl3DJavaFX_molecule.h
-
Embedded C code execution within Dpdl script (interpreted Mode 1)
-
Example Dpdl code that uses vec(...), map(...), list(...) and stack(...) data functions
-
Example Dpdl code that make use of the
>>task
keyword to execute embedded Dpdl code sections asynchronously -
Example Dpdl code that converts/compiles a 'struct' to a native java bytecode object and accesses member variables and methods
-
Example Dpdl script (dummy) that shows some functionalities of Dpdl
-
Example Dpdl script that shows how C code and Java can be embedded and executed within Dpdl
-
Example Dpdl script that shows how C code and Python can be embedded and executed within Dpdl
-
Example Dpdl script executes an embedded 'clojure' code that creates a simple UI to convert values from Celsius to Fahrenheit
clj/dpdlCljCelsiusConverterGUI.h
-
Example Dpdl script that embeds C++ code and uses ROOT API libraries to solve a linear equations in 4 different ways
-
Example Dpdl script that make use of Wgsl (WebGPU shading language) to speed-up computations for a high-performing neural network activation function (GELU) directly on GPUs
-
Example Dpdl script that embeds javascript code (with Mode2 using 'qjs') that loads an object implemented in a native C library (see point.c)
-
Example Dpdl script that compiles a WebAssembly WAT code to WASM binary format and calls the exported functions from both, Dpdl and javascript
-
Dpdl script 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 script that performs HTTP requests (GET, POST and PUT)
-
Example Dpdl script that embeds and executed an SQL query on a defined database and retrieves and prints out the result
-
Example Dpdl script 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
-
Example Dpdl script that launches multiple threads
-
Example Dpdl script that uses the JavaFX java library to render UI (Graphical User Interface) elements via a FXML definition.
-
Example Dpdl script that makes use of the type 'struct'
-
Example Dpdl script that makes use of the type 'class'
-
Example Dpdl script that shows how exceptions can be raised and handled
-
Example Dpdl script that parses an XML document with the xml pull parser
-
Example Dpdl script that makes use of multi-line structured text resources
-
Example Dpdl script that compresses and de-compresses a string of data using the Java platform API
-
Example Dpdl script with embedded ANSI C code that is compiled in memory and executed at runtime, the result is than intercepted
-
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 script that executes an embedded 'Julia' script to plots data using the 'Plots' package, and to save the chart as PDF
-
Example Dpdl script that executes an embedded 'Julia' script to download data via HTTP via url's contained in json data
-
Example Dpdl script that executes an embedded 'groovy' code (dummy)
-
Example Dpdl script using pointers and references
-
Example Dpdl code that writes and reads a data buffer to a file using the native library functions in 'libc'
-
Example Dpdl script embedding ANSI C code (ISO C99) that is dynamically compiled in memory at runtime (fast) and executed
-
Example Dpdl script that embeds JavaScript that intercepts some parameters that have been pushed on the dpdl stack
-
Example Dpdl script that embeds Clojure code
-
Example Dpdl script (embedded C code compiled at runtime) that launches threads (pThreads) to sum numbers
-
Example Dpdl script 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 script that embeds 'Julia' code to execute a set of threads that call a native C Dpdl API function
-
Load a Dpdl script object "LoadCodeFunc.h" via 'loadCode(..)' and call one of its functions
-
Example Dpdl app that uses the JavaFX java library to visualize a website within a WebView component
-
Parse JSON file and access data types
-
Parse JSON file and decode data into a struct
-
Example Dpdl script that updates the fields of a struct type via a dedicated thread
-
Embedded C code execution within Dpdl script
-
Embedded Python code execution within Dpdl script
-
Embedded Lua code execution within Dpdl script
-
Emedded Ruby code execution within Dpdl script
-
Embedding and executing structured code resources
-
Performs a discovery of bluetooth devices and saves the device addresses discovered in a record store
-
Executes the bluetoothDiscoverySave.h script continuously in a dedicated Thread instance
-
Array definition, population and access
-
Downloads a html website from a URL and saves the content in a local file
-
Inline execution of Dpdl scripting code
-
Accepts connections from a bluetooth server application and intercepts commands
-
Uses the Dpdl API library DoubleEmul and FloatEmul to emulate floating point and double precision math operations
-
Dpdl script that shows how to read and write data to a virtual record store filesystem
-
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, and a text and rectangle is drawn at random location on the draw panel.
-
Drawing functions on a UI Canvas on J2ME devices
-
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)
-
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
-
Small 'dummy' sample application
-
Example Dpdl code that leverages AI using the 'DpdlAINerd' (DAN) Dpdl language plug-in to generate and execute embedded code right away
-
Example Dpdl code that leverages AI using the 'DpdlAINerd' (DAN) Dpdl language plug-in to generate a json test dataset
-
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.