Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emdash/goof
A toy functional language created through the abuse of C
https://github.com/emdash/goof
Last synced: 21 days ago
JSON representation
A toy functional language created through the abuse of C
- Host: GitHub
- URL: https://github.com/emdash/goof
- Owner: emdash
- License: other
- Archived: true
- Created: 2010-09-25T20:34:23.000Z (about 14 years ago)
- Default Branch: no_commas
- Last Pushed: 2010-09-26T20:43:36.000Z (about 14 years ago)
- Last Synced: 2024-02-17T10:36:05.634Z (10 months ago)
- Language: C
- Homepage:
- Size: 121 KB
- Stars: 13
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: COPYING
Awesome Lists containing this project
- awesome-c-preprocessor - `emdash/goof` - - A toy functional language created through the abuse of C. (C language extensions)
README
Copyright (C) 2010 Brandon Lewis
Introduction
Goof is an experimental functional language with a novel implementation. It is
a library of functions and macros which combine to create the illusion that
you are writing in a high-level language. Despite this, goof programs are C
programs. They are compiled and executed like any other.Don't be fooled into thinking it's efficient: Goof is essentially a dynamic
language, with the runtime implemented directly in C.Goof programs are expressed as nested calls to functions and macros. Each
function returns a pointer to an object which implements a language contruct.Known Downsides (or, "Why in God's name are you doing this?")
- I just wrote it over the weekend for fun
- No memory management at present
- Dynamic implementation is probably inefficient
- I am largely ignorant of how concurrency might affect this system
- Possibly difficult to debug, and syntax erros are difficult to resolve due
to the heavy abuse of preprocessor macros.Potential Upsides
Though I acknowledge that this is really a pretty terrible thing to do to an
unsuspecting C programmer, I feel that there might be certain useful features
of this approach that are worth exploring. In addition to the well-known
advantages of functional programming, goof might offer the following:- educational value
- small implementation
- easy to add new constructs to the language
- easy to inter-operate between C and goof
- requires nothing other than a C compiler (after removing the glib code)
- you potentially mix and match different semantics within the same executable
(e.g. applicative versus normal order, eager versus strict, allow
non-deterministic evaluation etc).Liscence
Goof is available under LGPL v3