A statically typed lisp, without a GC, for real-time applications.
Go to file
2017-05-12 08:08:46 +02:00
bin send all args to carp-repl 2016-07-11 09:16:07 +02:00
docs https://gankro.github.io/blah/linear-rust/ 2017-05-12 08:08:46 +02:00
emacs pop-to-buffer is better 2016-04-13 21:13:59 +02:00
examples trying to find a way to optimize 2016-07-02 10:37:26 +02:00
img square version of logo without text 2016-07-14 16:07:54 +02:00
lisp Fix build errors on Linux (Ubuntu 14.04) 2016-07-14 20:04:52 +02:00
out cleaner solution to keeping 'out' directory around 2016-06-08 09:13:54 +02:00
shared removing exec permission from shared/*.h header files 2016-07-30 16:43:00 +10:00
src Merge pull request #64 from mkfifo/shared-includes 2016-08-01 16:32:09 +02:00
.clang-format first pass at clang-format 2016-07-06 12:05:20 +10:00
.gitignore ignore Makefile 2016-07-11 09:05:18 +02:00
.travis.yml travis: fixing sudo required syntax 2016-07-13 20:38:36 +10:00
CMakeLists.txt don't use the library path as the name for the libffi lib to link 2016-07-14 16:48:40 +02:00
globfiles.cmake CMake support for the c source 2016-02-17 08:23:10 +01:00
LICENSE new license 2016-08-23 15:43:10 +02:00
README.md Update README.md 2017-05-07 09:30:01 +02:00
xcode.sh Script for generating and opening Xcode project 2016-02-17 09:50:04 +01:00

Carp

Join the chat at https://gitter.im/eriksvedang/Carp Build Status

Logo

WARNING! This is a research project and a lot of information here might become outdated and misleading without any explanation. Don't use it for anything important!

Update (May 2017): The compiler is currently being rewritten to be much faster and more stable, the code will be uploaded here when it has achieved feature parity with the old version.

About

Carp is a small programming language designed to work well for interactive and performance sensitive use cases like games, sound synthesis and visualizations.

The key features of Carp are the following:

  • Automatic and deterministic memory management (no garbage collector or VM)
  • Inferred static types for great speed and reliability
  • Live reloading of code, REPL-driven development, a fun and helpful workflow
  • Ownership tracking enables a functional programming style while still using mutation of cache friendly data structures under the hood
  • No hidden performance penalties allocation and copying is explicit
  • Very good integration with existing C code

Learn more

A Small OpenGL/GLFW Example

(import gl)

(defn init []
  0f)

(defn tick [state]
  (+ state 0.15f))

(defn draw [state]
  (let [t @state
        steps 100
        step (/ 1f (itof steps))]
    (for (i 0 steps)
      (let [r (* step (itof i))
            r2 (+ r step)]
        (draw-line (* r (cosf (* t r)))
                   (* r (sinf (* t r)))
                   (* r2 (cosf (* t r2)))
                   (* r2 (sinf (* t r2))))))))

(defn spin []
  (glfw-app "Spin" init tick draw default-on-keys))

To build this example, save it to a file called 'example.carp' and load it with (load-lisp "example.carp"), then execute (bake-exe spin) to build an executable, or (spin) to run the program directly from the REPL.

Contributors

  • Erik Svedäng @e_svedang
  • Markus Gustavsson
  • Fyodor Shchukin
  • Anes Lihovac
  • Chris Hall
  • Tom Smeding
  • Dan Connolly
  • Reini Urban
  • Anes Lihovac
  • Jonas Granquist

License

Copyright 2016 Erik Svedäng

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.