/cl-rust-generator

Common Lisp based converter from s-expressions to Rust language source code

Primary LanguageCommon LispOtherNOASSERTION

Goal

Common Lisp package that converts S-expressions to source code of the Rust programming language.

Examples

01_gcd (finished)

from book, minimal

02_webgcd (finished)

from book

03_glium (aborted)

opengl binding. apparantly, original developer seems to have abandoned the approach in 2016. people still seem to use it. i just want to just get up and running with an immediate mode gui. this looks too cumbersome.

i tried this approach in cl-rust-adalm-pluto and couldn’t figure out how to call glTexSubImage2D to update a waterfall diagram texture. then i wrote the 08_glfw example which seems to expose opengl the way i know it.

04_azul (aborted)

  • perhaps this is easier to use for a 2d gui
  • too many dependencies

05_imgui (aborted)

  • shows imgui window
  • to cumbersome without learning more glium

06_parallel_text (finished)

  • example from book
  • shows how to generate a multi file projects
  • also contains a minimal firefox webextension to download a bunch of text file links

07_glutin_gl (aborted)

  • i’m not sure if i want to use glutin or glfw
  • glutin isn’t well documented compared to glfw
  • many glutin examples seem to show a different interface (e.g. EventsLoop)
  • i will use glfw for now
  • pulls in a lot of crates

08_glfw (finished)

  • this still pulls in a lot of crates (~70) but it seems to work well enough and is close to glfw docs
  • i also managed to compile it in windows (that needed microsoft builder tools, rust and cmake, though)

09_wasm

Simple wasm example

10_wasm_webgl

Wasm webgl example (only draws a triangle, no animation or event handling)

11_cuda

Add two arrays with rustacuda

12_imgui_wgpu (api has not stabilized)

webgpu is suppossed to replace webgl in browser. apparently, firefox only supports compute right now. the api is not stable yet.

Emacs config

for viewing the generated code

  • Install rust-mode and eglot with Melpa
  • rustup component add rls –toolchain stable-x86_64-unknown-linux-gnu
  • start company-mode, rust-mode and eglot-mode

FIXME: completion not working

Notes