Carp/README.md

97 lines
4.2 KiB
Markdown
Raw Normal View History

2016-01-11 16:52:26 +03:00
# Carp
2016-01-11 16:55:03 +03:00
[![Join the chat at https://gitter.im/eriksvedang/Carp](https://badges.gitter.im/eriksvedang/Carp.svg)](https://gitter.im/eriksvedang/Carp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![CI](https://github.com/carp-lang/Carp/workflows/CI/badge.svg)](https://github.com/carp-lang/Carp/actions?query=workflow%3ACI)
[![MacOS CI](https://github.com/carp-lang/Carp/workflows/MacOS%20CI/badge.svg)](https://github.com/carp-lang/Carp/actions?query=workflow%3A"MacOS+CI")
[![Windows CI](https://github.com/carp-lang/Carp/workflows/Windows%20CI/badge.svg)](https://github.com/carp-lang/Carp/actions?query=workflow%3A"Windows+CI")
2020-04-29 12:02:59 +03:00
<img src="img/carp_logo_300_c.png" alt="Logo" align="right"/>
2016-01-11 17:46:14 +03:00
2018-06-12 11:04:13 +03:00
<i>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 just yet!</i>
2017-05-07 10:27:19 +03:00
2019-07-05 12:52:30 +03:00
<i>[Version 0.3.0](https://github.com/carp-lang/Carp/releases/tag/v0.3.0) of the language is out!</i>
2018-09-19 17:00:29 +03:00
2017-05-07 10:30:01 +03:00
## About
2016-01-11 17:57:24 +03:00
Carp is a small programming language designed to work well for interactive and performance sensitive use cases like games, sound synthesis and visualizations.
2016-01-11 17:46:14 +03:00
The key features of Carp are the following:
2016-01-11 18:59:43 +03:00
* Automatic and deterministic memory management (no garbage collector or VM)
2016-01-11 18:55:41 +03:00
* Inferred static types for great speed and reliability
* 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 are explicit
* Straightforward integration with existing C code
2016-01-11 17:57:24 +03:00
2016-03-18 09:40:57 +03:00
## Learn more
2016-02-18 12:46:31 +03:00
2018-03-15 00:06:32 +03:00
* [Installation](docs/Install.md) - how to build and configure the Carp compiler
2017-06-26 13:04:39 +03:00
* [The Compiler Manual](docs/Manual.md) - how to compile code and configure your projects
2016-09-01 17:00:59 +03:00
* [Carp Language Guide](docs/LanguageGuide.md) - syntax and semantics of the language
2018-03-14 22:32:41 +03:00
* [Libraries](docs/Libraries.md) - how to work with libraries and modules
2017-11-03 16:08:27 +03:00
* [Tooling](docs/Tooling.md) - supported editors
2018-03-24 12:34:49 +03:00
* [Game Example](examples/reptile.carp) - a Snake clone in Carp
2016-01-13 16:12:42 +03:00
The Carp REPL has built-in documentation, run ```(help)``` to access it!
2016-01-13 16:12:42 +03:00
2018-03-24 12:34:49 +03:00
## A Very Small Example
2016-01-19 15:52:00 +03:00
2016-01-12 13:02:15 +03:00
```clojure
2018-03-24 12:34:49 +03:00
(load-and-use SDL)
(defn tick [state]
(+ state 10))
(defn draw [app rend state]
2018-03-24 19:20:43 +03:00
(bg rend &(rgb (/ @state 2) (/ @state 3) (/ @state 4))))
2017-06-26 12:22:55 +03:00
(defn main []
2018-03-24 12:34:49 +03:00
(let [app (SDLApp.create "The Minimalistic Color Generator" 400 300)
state 0]
2018-03-24 19:20:43 +03:00
(SDLApp.run-with-callbacks &app SDLApp.quit-on-esc tick draw state)))
2016-01-18 18:39:14 +03:00
```
To build this example, save it to a file called 'example.carp' and load it with ```(load "example.carp")```, then execute ```(build)``` to build an executable, and ```(run)``` to start. The external dependencies are SDL2 and pkg-config. On macOS Catalina libiconv is also required.
2016-01-12 13:02:15 +03:00
2017-12-01 01:07:04 +03:00
### Language Designer & Lead Developer
2017-12-01 01:10:39 +03:00
[Erik Svedäng](http://www.eriksvedang.com) ([@e_svedang](https://twitter.com/e_svedang))
2016-01-12 13:08:32 +03:00
2017-12-01 01:07:04 +03:00
### Core Contributor
2017-12-15 19:58:23 +03:00
[Veit Heller](http://veitheller.de) ([@hellerve](https://github.com/hellerve))
2016-01-12 13:08:32 +03:00
### Contributors
* Markus Gustavsson
* Fyodor Shchukin
2016-06-20 07:34:46 +03:00
* Anes Lihovac
2016-07-04 11:09:16 +03:00
* Chris Hall
* Tom Smeding
2016-07-11 08:33:48 +03:00
* Dan Connolly
* Reini Urban
* Jonas Granquist
* Joel Kaasinen ([@opqdonut](https://github.com/opqdonut))
* Eric Shimizu Karbstein ([@GrayJack](https://github.com/GrayJack))
2019-09-07 17:30:24 +03:00
* Jorge Acereda ([@jacereda](https://github.com/jacereda))
2020-04-21 01:18:45 +03:00
* Scott Olsen ([@scolsen](https://github.com/scolsen))
2020-04-29 12:15:17 +03:00
* Tim Dévé ([@timdeve](https://github.com/TimDeve))
2016-02-18 12:46:31 +03:00
Are you missing from the contributors list? Please send a pull request!
2016-08-23 16:42:39 +03:00
2016-01-19 15:29:06 +03:00
## License
2020-01-14 12:59:25 +03:00
Copyright 2016 - 2020 Erik Svedäng
2016-08-23 16:42:39 +03:00
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
2016-01-19 15:29:06 +03:00
2016-08-23 16:42:39 +03:00
http://www.apache.org/licenses/LICENSE-2.0
2016-01-19 15:29:06 +03:00
2016-08-23 16:42:39 +03:00
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.
2018-03-02 16:14:19 +03:00
The regular expression implementation as found in src/carp_regex.h are
Copyright (C) 1994-2017 Lua.org, PUC-Rio under the terms of the MIT license.
Details can be found in the License file LUA_LICENSE.