Skip to content
This repository has been archived by the owner on May 29, 2023. It is now read-only.

Latest commit

 

History

History
84 lines (58 loc) · 4.21 KB

readme.org

File metadata and controls

84 lines (58 loc) · 4.21 KB

Deprecated This project will not receive any updates! Glad if it helps as a skeleton to your own projects though

S7 & ImGui

Using s7 scheme alongside Dear ImGui to (interactively) build (cross platform) GUI apps.

You can see a video demonstration (of 0.1.0) here.

img/youtube-preview.png

Cross platform build: linux & windows with meson build system

Tested under

  • Windows 10 x64
    using msys2 for meson & ninja but I guess normal windows builds exist
  • Ubuntu 20.04

Docs

Some preliminary documentation of the provided namespaces is at docs/ns-doc.md
Auto-generated from the output of test/scheme/gen-doc.scm

Building

See dev.org

If you use emacs I recommend the org-babel-eval-in-repl package to make the most out of the snippets in that file.

Windows

Meson can generate the visual studio project for you, so you can build/run/debug there.

Linux

Eclipse CDT has meson support which I got working without too much fuss. The .cproject file is in the repo cause I couldn’t get eclipse to generate it automatically. The .project could be omitted. Generally, what was needed to be done was to manually add the following natures in the project:

  • meson
  • c
  • c++

Again, the .cproject was needed for the indexer to work. I copied it from a new generated meson project.

Also I’ve found that KDevelop works quite well. This is what I’m using lately.

macOS

Feel free to test it & make a PR. I don’t have any mac/hackintosh.

Cross compiling

Meson has cross compiling support. Haven’t tested it at all though.

Rationale

After discovering clojure and enjoying the satisfaction of working with a REPL, I wanted to have something like this for native desktop applications (and specifically with c/c++ for specific applications, so no java/clojure).

Also, building things is still not fun for c/c++ projects. Some short-lived explorations with Juce got me scratching my head: you have to use a tool (named projucer) to generate the visual studio/xcode project files.. I didn’t like this process, confused me.

Recently I stumbled upon meson and, without usince c++ since 2013, I was glad to see how quickly I could use some libraries & even write build definitions for existing projects. It was a nice opportunity to see how things work & not use ready frameworks.

So there you go.

Testing

C++ (gtest)

  • [ ] fix/think about the needed pwd while running the tests (for loading scheme files & testing screenshots etc)

right now you have to be in the build/test dir (assuming build is the directory you configured meson with)

Scheme

I’m running the build/repl src/scheme/test-all.scm command

test/scheme/assets/sxs-wheel-snapshot.png

for example.

Roadmap

  • [X] proof of concept
    • embed s7 and draw something with imgui from s7
    • use a REPL and work with cmuscheme in emacs
  • [X] (semi)complete the bindings of imgui for s7: checkboxes, lists, menubar etc
  • [X] video demonstration / getting started: windows and/or linux
    I’m thinking of doing a really basic text editor (open - edit - save) with imgui/scheme etc. Live coding using the REPL see https://youtu.be/MgHsl0u26MY
  • [ ] create a documentation of the namespaces from C bindings but as well from provided scheme files.
    • see the generated docs/ns-doc.el for now
    • the idea is to generate an org or markadown file from this
    • hide “private” things from the documentation (probably names that start with -)
  • [ ] Think (again) about the namespaces. See #3 . Any input from schemers would be greatly appreciated