Commit Graph

809 Commits

Author SHA1 Message Date
Tim Dévé
da25a255e9
feat: Adds flag to always output C id with headerparse (#1353)
Adds -c|--emitcname flag to headerparse to always emit the C identifier
in `register` definitions (useful when the register will be in a
module).

Fixes a bug where the kebab case flag would not output C identifiers
making the emitted C identifiers not match with the ones in the headers.

Adds docs entry about headerparse in CInterop doc.

Makes headerparse emit `CChar` instead of `Char` when encountering a
signature containing `char`.
2021-11-03 09:09:26 +01:00
Scott Olsen
f4bcc28fc0
feat: register-type improvements (#1332)
* fix: don't instantiate dummy fields for external types

For ANSI C compatibility reasons, we add a dummy field for memberless
types defined in Carp (see commit 59ef5bbf2b). When registering a type
with no fields, `(register-type A [])`, we'd also attempt to set our
dummy field in the Carp generated initializer for the type. However, the
registered type is totally opaque from the perspective of Carp, and we
can't assume it has a field corresponding to our dummy field.

This commit changes our handling of __dummy in initializers to avoid
setting it for registered types.

* feat: automatically implement str and prn for registered types

This commit makes the auto-generated str and prn functions for
registered types implement the str and prn interfaces, removing the need
for users to call implements on these functions explicitly.

It alters the signature of `autoDerive` in Primitives.hs slightly to
make it more flexible (since registered types have no delete or copy
functions that we can add to the implementation lists of these
interfaces).

* docs: add docs on register-type to CInterop.md

The new documentation clarifies the usage of `register-type` and accounts
for the changes in the prior two commits.

* fix: fix function signatures for generic memberless initers

Filter out dummy field arguments.

* docs: Add details about type name overrides to CInterop.md

* docs: clarify that users can implement delete for registered types
2021-10-18 16:48:02 +02:00
Scott Olsen
9e12750842
docs: fix typo in Macros.md (#1331) 2021-10-12 17:52:24 +02:00
rgkirch
998948ec6b
Update Install.md (#1324) 2021-10-11 16:02:33 +02:00
Veit Heller
0188264463
feat: add compiler error on maximum sumtype constructors (#1319) 2021-09-18 08:49:19 +02:00
Erik Svedäng
5cc691be56 build: 0.5.2 2021-09-08 19:59:00 +02:00
Veit Heller
39b1e8e5fa
docs: add pattern limitations (#1268)
* docs: add pattern limitations

* docs: incorporate feedback by @guberathome into pattern limitations
2021-07-02 10:41:49 +02:00
Erik Svedäng
09c91c7f90
feat: Emit docs for top level bindings (#1253)
* refactor: Tiny cleanup before we begin

* refactor: Moved module finding to its own local function

* feat: save-docs-internal is now a binary command

* feat: This seems to work

* fix: Cleaned up the code, save-docs now emit one module per file listed
2021-06-28 19:56:59 +02:00
Tim Dévé
bfe30e9dd6
docs: Updates memory docs to discourage overriding delete (#1245) 2021-06-15 10:42:13 +02:00
Veit Heller
f7785ad93d
fix: render submodules in html docs (#1242)
* fix: render submodules in html docs

* fix: also render deeply nested modules

* feat: no prefixes in nested submodule doc rendering

* fix:  fix text alignment of module index for sdl

* feat: make submodules expandable
2021-06-11 13:02:52 +02:00
guberathome
e9537a8ba9
PR: additional local documentation as html (#1229)
* docs: implemented python script to convert local documentation from .md files to .html files

* docs: filled index.md; reviewed all references in .md files

* docs: updated Embedded.md and resized carp_on_arduboy.jpg to sensible width

* docs: copy sub folders (./docs/core and ./docs/sdl) to ./docs-html/ and refer docu to it

* docs: phrased requirements more clearly

* docs: generate docs for Standard libraries before converting .md docs to .html

* docs: change index to markdown lists

* docs: index.md worked around limitation in md converter

* docs: removed modules count from Libraries.md

Co-authored-by: guberatsie <gunnar.bernhardt@siemens.com>
2021-05-31 10:15:09 +02:00
Erik Svedäng
889f55fe8f
feat: Remove address (#1223)
* chore: Abuse deftemplate to get rid of Address

* chore: Avoid semicolon at end of define

* fix: address should be useable as an argument to a HOF

* chore: adapt examples to new address signature

* fix: Remove Address from typeOf

* fix: Remove more uses of Address

* fix: Remove more mentions of address in the Haskell code

* fix: Remove test that ensure you can't take the address of non-symbols

* refactor: Moved `address` to Pointer.carp

* refactor: Move address into Pointer module

Co-authored-by: Jorge Acereda <jacereda@gmail.com>
2021-05-27 22:04:46 +02:00
Scott Olsen
d8d3669a16
feat: add 'when' functions for Maybe and Result (#1180)
* feat: add 'when' functions for Maybe and Result

These functions enable users to execute some side-effecting function
(one that returns unit and take no arguments) based on the contents of a
Maybe or Result.

`when-success`: Executes a side-effect when given a `Result.Success`
`when-error`: Executes a side-effect when given a `Result.Error`
`when-just`: Executes a side-effect when given a `Maybe.Just`
`when-nothing`: Executes a side-effect when given a `Maybe.Nothing`

* docs: add Control to core lib doc generation
2021-03-15 09:53:22 +01:00
Scott Olsen
1458bf4031
feat: Add support for emitting literal C (#1178) 2021-03-04 07:29:52 +01:00
Tim Dévé
19c1a4c557
feat: Adds defn- and def- macros (#1174)
* refactor: Groups Dynamic together in Macros.carp

* fix: Fixes doc for `hidden` referring to the wrong symbol

* feat: Adds defn- & def- macros

Adding these macros as a shortand for declaring a def or defn and making
them `hidden` and `private`, useful to keep things internal to a module.

* test: Adds expected error output tests for def- & defn-

* refactor: Changes position of Module and Interface section in LanguageGuide

Trying to introduce concepts in the same order they are referred to in
the examples: structs > modules > interfaces.

* docs: Adds private & hidden section in the LanguageGuide
2021-03-03 08:57:36 +01:00
Erik Svedäng
ee54291646 docs: Change the order of the actions in the release checklist 2021-02-01 19:24:15 +01:00
Veit Heller
d20414e87d
feat: Add drop interface (#1088)
* add sketch for drop

* add drop example

* correct drop ordering

* fix: simplify drop and add to deleter

* docs: add drop docs

* fix: use a sound lifetime var
2021-01-31 21:15:10 +01:00
Veit Heller
384c41909d
feat: add deprecation meta (#1136)
* feat: add deprecation meta

* refactor: print only deprecated

* refactor: add argument to deprecated

* fix: make deprecated work early on
2021-01-26 13:22:50 +01:00
Veit Heller
144b114cda
docs: don’t confuse liquid (#1152) 2021-01-26 13:21:20 +01:00
Veit Heller
8c1999d656
feat: add fstr (#1142)
* feat: add fstr

* test: add fstr test

* fix: memory error in test

* fix: fix backslash parser

* feat: add octal escape literals
2021-01-26 06:18:16 +01:00
Veit Heller
9cfde34fbc
docs: add Introspect and Unit (#1147) 2021-01-24 22:44:47 +01:00
Veit Heller
2023c93d62
feat: Quasiquotation (#1129)
* feat: quasiquotation

* test: add tests for quasiquotation

* fix: fix typo in call to doc

* fix: do not evaluate quasiquote too eagerly

* test: pull quasiquote test into macro

* docs: fix unquote example with better constant

* feat: add quasiquote literals

* refactor: simplify reader macros
2021-01-15 10:50:04 +01:00
Veit Heller
02936cc74c
feat: Derive (#1120)
* core: add derive

* fix: fix errors with set!

Notably, don't type check dynamic bindings (which can be set to
whatever) and eliminate a hang that resulted from not handling an error
at the end of the `set!` call. Also refactors some of the code in
efforts to make it a bit cleaner.

Also adds an error when `set!` can't find the variable one calls set!
on.

* feat: better derive

* test: add error test for derive

* document derive

* add derive to core documentation to generate

* core: add derive

* fix: fix errors with set!

Notably, don't type check dynamic bindings (which can be set to
whatever) and eliminate a hang that resulted from not handling an error
at the end of the `set!` call. Also refactors some of the code in
efforts to make it a bit cleaner.

Also adds an error when `set!` can't find the variable one calls set!
on.

* feat: better derive

* document derive

* feat: first completely working version of derive

* feat: make name of derivable customizable (thanks @scolsen)

* refactor: implement doc edits provided by @scolsen

* feat: change argument order for derive

* fix: change deriver error test

* test: add derive tests

* fix: change order of derive back

* docs: fix typo in derive document

Co-authored-by: scottolsen <scg.olsen@gmail.com>
2021-01-15 10:48:34 +01:00
Efi
eb1e060f54
Documentation on Structs (#1110)
* Update LanguageGuide.md

Clarify Struct instantiation and usage.

* Update LanguageGuide.md

* Update LanguageGuide.md

* Update docs/LanguageGuide.md
2021-01-03 13:24:00 +01:00
Erik Svedäng
5999f58347
docs: Typo 2020-12-23 10:02:18 +01:00
Erik Svedäng
8336e5354f docs: Basic information about match-ref 2020-12-23 09:55:31 +01:00
Erik Svedäng
817887672f fix: Remove misleading docs regarding config.carp, closes issue #1080 2020-12-23 09:46:11 +01:00
Veit Heller
5f6f29016b
docs: document delete (#1087) 2020-12-22 10:30:37 +01:00
Efi
7d4db3df06
Fix link to Memory.md in patterns.md (#1073) 2020-12-16 10:09:00 +01:00
Tim Dévé
1863c82559
chore: Creates pre-commit hook to format Haskell code (#1047)
* chore: moves git hook into own folder

This is is done in preparation of having other git hooks

* chore: Creates script to run formatter

* chore: Checks that ormolu is installed before running it

* chore: Adds pre-commit hook to format Haskell files

* chore: Ensures the ormolu instruction are outputted when running hook

* chore: Prints formatted files on newlines
2020-12-05 14:26:28 +01:00
Tim Dévé
0bd5fa4cb6
chore: Creates git hook to enforce Conventional Commits (#1041)
* chore: Adds Conventional Commits commit-msg hook

* docs: Adds section about git hooks in Contributing Guide

& fixes the headers hierarchy
2020-12-01 14:38:45 +01:00
Tim Dévé
ac4231d005
docs: Expands docs around C function pointers (#1038)
* docs: Generates HTML docs for Function core module

* docs: Adds lifetime information in Function module

* docs: Adds callback section to C Interop

* docs: Corrects typos in Function docs
2020-12-01 10:44:03 +01:00
Erik Svedäng
9edce5a356 docs: One more step to ReleaseChecklist.md 2020-11-30 16:13:29 +01:00
Scott Olsen
541630569c
Docs: Make ref-let pattern a bit clearer (#1016) 2020-11-24 19:28:15 +01:00
Erik Svedäng
d888c8c9cd
docs: Better credits and contribution guide (#1010)
* docs: Cleaned up the "credits" section a fair bit

* docs: Unified list of maintainers

* Update README.md

Co-authored-by: Erik Svedang <erik@Eriks-iMac.local>
2020-11-24 16:47:44 +01:00
Erik Svedäng
7bd1b122bf docs: Clarifications 2020-11-24 06:45:51 +01:00
Erik Svedäng
ada8cd9b48
docs: A document about running code (#1013)
* docs: A document about running code

* fix: Tweaks

* docs: More information about running code

Co-authored-by: Erik Svedang <erik@Eriks-iMac.local>
2020-11-24 06:40:31 +01:00
Erik Svedäng
793bf19ede
docs: Remove a lot of duplicated information and refer to webpages instead (#988)
* docs: Remove a lot of duplicated information and refer to webpages instead

* fix: Remove line about (help), it does not make sense anymore

* fix: Add open-browser to nix config

Co-authored-by: Erik Svedang <erik@Eriks-iMac.local>
2020-11-23 09:58:06 +01:00
Erik Svedäng
26ed4b7b52
docs: Release checklist (#999)
Co-authored-by: Erik Svedang <erik@Eriks-iMac.local>
2020-11-22 22:24:04 +01:00
Tim Dévé
6593a64a19
Adding more documentation around C Interop (#984)
* Adds C Interop documentation for Strings

* Replaces usage of triple backticks with single when used in a paragraph

* Adds link to new C Interop docs in the Language Guide

* Small tweaks to wording in C Interop doc

* Adds Array section to C Interop doc

* Adds deftemplate examples in C interop doc

* Small copy change in C interop doc

* Adds identifiers section in C interop doc
2020-11-21 21:28:42 +01:00
Erik Svedäng
041d929fc6 fix: Level of heading 2020-11-20 08:25:20 +01:00
Erik Svedäng
a2c4e34e1a feat: Multimedia.md 2020-11-20 08:24:36 +01:00
Erik Svedäng
3192d54ae9
refactor: Move emacs-mode to separate repo (#981) 2020-11-20 07:48:21 +01:00
Erik Svedang
a270365553 fix: Sort modules alphabetically (manually, for now) 2020-11-20 00:46:52 +01:00
Erik Svedang
2df93a0275 fix: One more link 2020-11-19 21:45:33 +01:00
Erik Svedang
9530bff9ab fix: Correct links 2020-11-19 21:44:49 +01:00
Erik Svedang
0fd7c8828f chore: Remove SDL docs 2020-11-19 21:43:02 +01:00
Erik Svedang
3df10e997c feat: Better docs structure 2020-11-19 21:24:34 +01:00
Erik Svedang
7932fc8612 fix: Regarding CARP_DIR 2020-11-19 21:12:17 +01:00
Erik Svedang
78645d0579 fix: Clean-up and clarifications regarding libraries 2020-11-19 21:10:40 +01:00