{"id":17823073,"url":"https://github.com/artofcode-/concaten","last_synced_at":"2025-04-02T10:29:35.636Z","repository":{"id":69665630,"uuid":"88972518","full_name":"ArtOfCode-/concaten","owner":"ArtOfCode-","description":"A programming language that can be used for programming things","archived":false,"fork":false,"pushed_at":"2017-04-21T05:46:29.000Z","size":489,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T01:35:00.740Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArtOfCode-.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-21T10:26:20.000Z","updated_at":"2018-10-26T02:59:46.000Z","dependencies_parsed_at":"2023-09-16T11:24:54.211Z","dependency_job_id":null,"html_url":"https://github.com/ArtOfCode-/concaten","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtOfCode-%2Fconcaten","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtOfCode-%2Fconcaten/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtOfCode-%2Fconcaten/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtOfCode-%2Fconcaten/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArtOfCode-","download_url":"https://codeload.github.com/ArtOfCode-/concaten/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246796434,"owners_count":20835387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-27T17:50:45.084Z","updated_at":"2025-04-02T10:29:35.607Z","avatar_url":"https://github.com/ArtOfCode-.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Concaten v0.9.2\n\nConcaten is a concatenative, stack-based, strongly and strictly\ntyped, hyperdynamic, garbage-collected, interpreted programming language. In\norder, that means that:\n\n1. **concatenative** - Each \"word\" (Concaten's version of a function) is\n  applied to the results of the one that appears before it in the source code.\n  There are a few exceptions, though; notably, `{` and `-\u003e`. The full spec\n  explains how those words work; it'll be available as part of v1.0.\n2. **stack-based** - Results, rather than being passed directly to methods or\n  stored in variables, go onto an intermediary data stack, on which they can\n  stay indefinitely. Note that this may occur in other languages like C, as\n  part of the implementation of passing parameters to methods; however,\n  Concaten's is persistent -- C's, if not empty after all the parameters have\n  been passed to the method, is messing something up.\n3. **strongly**... - \n  under no circumstances does the language itself coerce something between\n  types. This doesn't, however, prevent certain library functions (i.e. those\n  beginning in `*`) from doing that; it just means that it has to be done\n  explicitly in some code, as opposed to being done implicitly by the language.\n4. **and strictly typed** - All methods related to variable assignment\n  take a type as a required parameter, and check that the datum to be stored\n  is of that type. The types are similar to interfaces in languages like C#\n  and Java -- they define a set of methods that a given object must have to be\n  passable. However, they make no limitations on the content of the methods.\n  It wouldn't be inaccurate to call this fail-fast duck typing.\n5. **hyperdynamic** - Every keyword is an overrideable (though *not*\n  replaceable) word, and everything is an object that can have methods\n  monkey-patched in or out. Every function's code can be read, analyzed, and\n  changed at runtime. The one exception to this is an object's properties --\n  to allow fundamental objects and methods to be implemented in the\n  interpreter's language, either for speed boosts or simplicity, properties\n  are neither visible nor editable outside of that object's methods.\n6. **garbage-collected** - You don't need to worry about memory; Concaten will\n  handle it for you with a reference-counting garbage collector. Because of\n  its nature, you can also usually rely on the GC deleting and destructing an\n  object when you expect it to -- in comparison to tracing GCs, which run\n  effectively whenever they want to, a refcounter imposes a constant, slight\n  overhead in exchange for deleting an object as soon as it's no longer used,\n  which means that destructors have meaning. As long as cyclical references\n  are avoided, at least.\n7. **interpreted** - Rather than being converted to machine language or\n  assembly, then executed directly by the CPU or OS, Concaten code is executed\n  as-is by an intermediary program. Depending on the OS and specific\n  circumstances, this might be abstracted away such that the user doesn't see\n  it happening directly (e.g. through Windows' file extension assocations);\n  under the hood, it always is.\n0. **programming langauge** - Hopefully, if you're reading this,\n  self-explanatory.\n\nFor an example of how the language will probably look, see `test.ctn`.\n  However, keep in mind that this is subject to change; though the language is\n  specced out, actual usage might reveal things that I didn't consider, and\n  therefore need to add in, remove, or change.\n\n### Documentation\n\nDocumentation is (or, if it isn't, will soon be) available in the form of a\nfunction (\"word\") reference, a glossary, and guides. See `docs/README.md` for\nmore information.\n\n### Installing\n\nInstalling Concaten is simple if you have `git`, `cmake` and `make` installed.\nJust run this command:\n\n    git clone https://github.com/nic-hartley/concaten.git \u0026\u0026 \\\n    cd concaten \u0026\u0026 cmake . \u0026\u0026 make\n\nThis will clone the `master` branch of the repositiory (which has the latest\nstable version) and build it. If you'd like the bleeding-edge version, which\nmight not always compile, let alone function correctly, do `git checkout dev`\nimmediately after `cd`ing.\n\nIf you don't have CMake or Make installed, or prefer not to use them, you can\nprobably get the Concaten executable by running this command:\n\n    cc -Wall -Wextra -Werror -pedantic -O3 -std=c11 -oconcaten \\\n        [^t]*.c t[ko]*.c stl/*.c -lm\n\nWhile this _should_ work, I say \"probably\" because, firstly, it was written\nwith GCC in mind, and as such the syntax may not be correct for, say, MSVC.\nSecondly, I'm not going to keep this as up-to-date as the \n\nIf you discover any issues, please report them on GitHub.\n\n### Helping out\n\nIf you want to contribute code, awesome! Be sure to check out `CODE_STYLE.md`.\n\nIf you don't feel like contributing code, but want to help, first install\nConcaten as described above, then run `./tester`. Then, send me the output\n(presumably, you can get to me somehow; I doubt you found this on your own). \n\nIf everything succeeds, the output will look something like this:\n\n    Testing code_block...       42 succeeded in   37 us.\n    Testing data_stack...       43 succeeded in   18 us.\n    Testing method_map...       46 succeeded in   52 us.\n    Testing object...           38 succeeded in   69 us.\n    Testing prop_map...         37 succeeded in   39 us.\n    Testing stringbuilder...    24 succeeded in   22 us.\n    Testing token_stack...     106 succeeded in   12 us.\n    Testing tokenizer...        28 succeeded in  426 us.\n    Done with all tests\n\nThe numbers may be different; I'd appreciate a copy/paste so I can see\n(roughly) how fast different things are on different machines.\n\nIf it failed at any stage, you'll see something like this:\n\n    /path/to/dir/tests/foo.c:123: Failed something-or-other\n    1 failed in 12 us.\n\nAnd no further tests will be run. If it fails to compile, you'll see GCC\nerrors; please report those, too.\n\nIf you get a segfault, that's especially important. Please try to track it\ndown; since I don't have unlimited access to your machine, I can't really find\nthe bug.\n\nI'd also appreciate it if you ran the main executable (`./concaten`) on any of\nthe code samples, especially `demo.ctn`.\n\n---\n\n**A note about versions**: My format is `major.milestone.submilestone`, where\n  each is the number for the most recently finished. For example, version\n  `1.1.1` just completed the first task of milestone 2 of verison 1. Note that,\n  despite the superficial similarity, versions are not numbers: `1.10` comes\n  after `1.9`. A \"submilestone\" is a piece that's big enough to warrant its\n  own marker, but not big enough to warrant its own milestone.\n\nMajor version `0` is pre-completion; some of the parts may be\n  done, but not all of it. Major version `1` is the first completed version of\n  the language; from there, I'll iterate based on feedback and input from the\n  users, and implement niceties.\n\nVersions only apply to that branch. For example, dev might be at 1.6.3, while\n  master is on 0.5.7; that just means that the bit that's on dev is incomplete\n  and not ready to be pushed to master yet.\n\n---\n\n### Current milestone\n\n#### Minimal Standard Library - 0.10\n\n* [ ] Minimal standard library - 0.10  \n  Words like `if`, `{`, and `puts` so we can play with the language at all.\n  * When designing/adding arrays, add the same methods to `CodeBlock`\n  * If necessary, create `ctno_mk_` family to automatically create things\n  * [ ] `integral` methods\n  * [ ] `real` methods\n  * [ ] Make sure `integral` and `real` can be added together\n  * [ ] `string` methods\n  * [ ] `code-block` methods\n  * [ ] `{` word\n  * [ ] `[` word and lists\n  * [ ] Control words (`if`, `each`, etc.)\n  * [ ] `puts` and `*puts`\n\n### Upcoming milestones\n* [ ] Misc. required updates as needed - 0.11\n  * [ ] Thorough code review  \n    Finding places where the code is needlessly complicated, duplicated, or\n      the like, and fixing it.\n    * Make sure `PropMap` and `MethodMap` have the same interface, to the\n      extent possible.\n    * Ditto for the three stacks.\n  * [ ] Profiling/optimizing.  \n    Design some code that'll test as many features as possible, as strenuously\n      as possible, so that we have a good program to benchmark and profile\n      with. I want to optimize the slowest parts.\n  * [ ] Make sure nothing leaks memory.  \n    There are a lot of places where memory could get leaked, especially in the\n      standard library. Go through and make sure none of them are actually\n      leaking anything.\n  * [ ] Benchmarking between Concaten and equivalent-level languages  \n    Probably Python or Ruby. I want at most 3x time taken, and for that value\n      to be as low as possible.\n  * [ ] Informative error messages! Right now it's a code, which you can look\n    up in `error.h`, but without knowing the codebase as well as its author,\n    the meaning probably isn't clear.\n  * [ ] Can code blocks and types be lists of tokens and identifiers\n    respectively? Just with a couple of extra methods.\n* [ ] Documentation - 1.0  \n  Including demo code, a detailed up-to-date list of every default global word\n    (like `if`) and what they do, every built-in method, and a brief overview\n    of how Concaten works, as well as how to install it and what the\n    command-line arguments are (or at least, what they're gonna be).  \n  In theory, mostly done (because of the spec, and you did this while writing\n    the standard library, *right*?), but in practice, it probably should be\n    rewritten.\n* [ ] Beta testing  \n  Hand out the interpreter as it is to as many people as possible, get them\n    to play with the language and try to break it.  \n  We want lots and lots of people trying it out, so we can get lots of\n    feedback and iterate quickly.\n  * [ ] Create `FEEDBACK.md`; should contain a link to give bug reports and\n    feature requests seperately, as well as asking people to run the test\n    suite and a couple of test programs on their machine to make sure it all\n    works properly. It'll also explain what to do if you get a confusing\n    error message (which is mostly tell me what you were doing so I can\n    repro and make a better error message)\n* ***Take a break.*** You just wrote an entire programming language. Give it a\n  week or two, play with it a little, but don't start working on the next bits.\n  Bugfixes only.\n* [ ] Command-line options - 1.1  \n  Definitely at least `-e`; take inspiration from Ruby and Python.  \n  These should mostly be minor variations on the existing main method.\n* [ ] Debug mode - 1.2  \n  Allows breakpoints (w/ `breakpoint`?) and stops execution when exception is\n    thrown outside of a `try`.\n* [ ] User-created libraries - 1.3  \n  `namespace` word that uses some Concaten magic to let people define their\n    own modules. This is in part to encourage other people to write ~~my code\n    for me~~ extensions to Concaten, and in part to set up the framework for\n    the next milestone(s).\n* [ ] Decide which extension libraries to implement, scatter the rest over 2.0\n  and 3.0 as appropriate. These will form the next 1.x updates.\n  * Networking\n  * File I/O\n  * String manipulation\n  * Math\n  * Regex (that'll be a lot of effort)\n    * Optionally, use an external library, integrated with this.\n  * GUI (ditto)\n* [ ] Multithreading/thread safety - 2.0  \n  This is going to require something close to a complete rewrite, to make sure\n    everything is as thread-safe as it can get. Note that this is deliberately\n    a bullet list, not checkboxes, since it's ideas at this stage.\n  * Make everything thread-safe (mutexes on read/write; allow parallel reads\n    but not parallel writes)\n    * `set`s lock a mutex for the entire time; `get`s lock and immediately\n      unlock them? (to sync, make sure that gets don't occur in the middle of\n      a set)\n      * Maybe disable this until first thread created, then enable it? (for\n        performance in single-threaded applications)\n    * Each thread gets its own copied, but independent, stacks/scopes; passing\n      data has to be done very intentionally. (This also removes the need\n      for synchronization on the stacks, which would get expensive)\n    * Force sync between reads/writes of console/files; GUI updates?\n  * [Task](https://msdn.microsoft.com/en-us/library/dd537609.aspx)s?\n  * Asynchronous versions of the Networking and File I/O APIs.\n  * Events? (technically possible already, but easier with multithreading)\n* [ ] C code linking at interpret-time (like Python) - 3.0  \n  That way, people can write Concaten libraries in C, for what'll probably be\n    a slight speed boost, but also lower-level access to the OS than Concaten\n    allows.\n* [ ] Full Unicode support - 4.0  \n  Correctly interprets source code with Unicode characters (might already, but\n    needs testing); strings go from collections of ASCII bytes to collections\n    of Unicode codepoints.  \n  Also, support Unicode in string-modification/i18n modules.\n\n### Previous milestones\n\n* [x] `tokenizer.h` - 0.0  \n  Converts a stream of characters into a stream of tokens. That way, the\n    interpreter doesn't need to even think about things like comments or\n    whitespace -- it just takes the tokens and runs with them.  \n  Can read from both a string in memory and a file on the disk directly. The\n    former will make `eval` easier to code, and the latter makes the\n    interpreter a little easier to write.\n* [x] `object.h` - 0.1      \n  The building block of the language. Even lambdas are manipulatable objects.\n    Can store any type of data, because Concaten is dynamically typed, after\n    all.\n* [x] `data_stack.h` - 0.2  \n  The central data stack. Contains intermediary results; words pull their\n    arguments from it and push their results to it.\n* [x] `token_stack.h` - 0.3  \n  Where tokens get pulled from during program execution.\n* [x] `code_block.h` - 0.4  \n  A simple object which represents Concaten's equivalent of anonymous\n    functions. Can be run, in addition to being modified at runtime, as it's\n    simply an array of tokens with some extra words (`call`, for example).\n* [x] Refactor to interface consistent across all bits and pieces - 0.5  \n  The code is getting a little out of hand. I have some things I want to do to\n    clean it up. (Fun fact: This bit took more time than any other milestone,\n    I think. Just goes to show how important planning in advance is.)\n* [x] `runnable.h` - 0.6  \n  A combination object so I can either define things in Concaten, through\n    code blocks, or in C, through functions with a certain signature, and\n    call them without worrying about which is which. This layer of abstraction\n    will make it much easier to implement user-defined words.\n* [x] `scope_stack.h` - 0.7  \n  Contains the list of words. This is a stack so we can sensibly implement\n    things like local variables. Shouldn't be too much trouble; it'll mostly\n    be combining `PropMap` and `DataStack`.\n* [x] Main method - 0.8\n  Simple main method; untestable without the standard library.\n* [x] `type.h` - 0.9  \n  A simple class to contain the types, which are basically interfaces (I call\n  them fail-fast ducktypes, to sound unique).  \n  This should have been done earlier, but it was forgotten. Whoops.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartofcode-%2Fconcaten","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartofcode-%2Fconcaten","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartofcode-%2Fconcaten/lists"}