{"id":13778832,"url":"https://github.com/sebastien/k7","last_synced_at":"2025-04-14T21:03:59.304Z","repository":{"id":436281,"uuid":"57301","full_name":"sebastien/k7","owner":"sebastien","description":"A standard library for the V8 JavaScript interpreter","archived":false,"fork":false,"pushed_at":"2009-10-03T16:07:15.000Z","size":2264,"stargazers_count":73,"open_issues_count":18,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-17T14:40:53.658Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"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/sebastien.png","metadata":{"files":{"readme":"README","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}},"created_at":"2008-09-28T17:42:47.000Z","updated_at":"2022-11-21T08:53:54.000Z","dependencies_parsed_at":"2022-07-08T07:44:34.466Z","dependency_job_id":null,"html_url":"https://github.com/sebastien/k7","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/sebastien%2Fk7","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastien%2Fk7/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastien%2Fk7/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastien%2Fk7/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebastien","download_url":"https://codeload.github.com/sebastien/k7/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226856963,"owners_count":17693016,"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-08-03T18:00:57.980Z","updated_at":"2024-11-28T04:14:19.595Z","avatar_url":"https://github.com/sebastien.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"== K7 - A standard library for V8\n== Project description\n-- Author: Sebastien Pierre \u003csebastien@type-z.org\u003e\n-- Date:   28-Sep-2008\n\n\n[V8] is a fast JavaScript interpreter that can be easily embedded in C and C++\napplications. The K7 projects aims at creating a high-quality standard library\nfor V8 by taking advantage of its embedding facilities.\n\nThe main goal of K7 is to offer an infrastructure that *makes it easy to write\nextensions* to the V8 interpreter. A couple of open-source projects started with\nthe goal of creating a JavaScript server-side environment, but none of them is\neasy to use, provide good documentation and guidelines so that newbies could\nstart writing extensions in minute.\n\nOne of the main goal of K7 is to enable people to write a module for their\npreferred library without having to learn too much new information, and to be\nguided in the process. As a result, K7 is designed on the following principles:\n\n  - Macros to ease the pain: you can easily write extensions using a set of C\n    macros that are rather straightforward to learn.\n\n  - Module system: extensions are shipped as modules (or submodules) that fit\n    into a predefined module tree, and can be loaded on demand (look at\n    API.yaml) for more information.\n\n  - Convention-based: to ensure that all the extensions fit nicely together, we\n    provide a set of conventions based on the existing JavaScript library.\n\nAdditionally, there are a couple of principles that should be followed when writing\nextensions:\n\n  - Be simple: avoid writing complex extension modules with lots of functions\n    and classes.  Provide binding to standard, well-known API (like POSIX). This\n    allows to keep the extensions simple, make maintenance and usage easier.\n\n  - Use JavaScript for objects: prefer writing pure-JavaScript modules that take\n    advantage of extension modules rather than putting everything in the C++\n    extension. For example, a module providing a 'File' object should be written\n    in pure JavaScript, and take advantage of the 'posix' API for the actual\n    I/O.\n\n  - Limit dependencies: when you want to start writing an extension, pick a\n    library that is designed in the UNIX philosophy, that does not have too many\n    dependencies and do on thing well (like 'libcurl', for instance).\n\nThe K7 source code is separated in two main folders:\n\n  - 'src' which contains the K7 main source code, which is basically the\n    interpreter enhanced with a couple of simple primitives and the\n    macros.\n\n  - 'lib' which contains the JavaScript and extension modules source code, and\n    which is laid out according to the modules hierarchy. For instance, the\n    'system.posix' extension module will be located as\n    'lib/system/posix/posix.cpp' file.\n\nTo get started, you'll need a POSIX environment with a compiler, and\n'subversion' and 'scons' installed. Typing\n\n\u003e   make\n\nShould be sufficient to create the 'k7' interpreter, compiled with extensions.\nV8 will be downloaded automatically to your 'deps/v8' directory.\n\nYou have a couple of options that you can activate:\n\n\u003e   make compact    # Builds a compressed K7 executable\n\u003e   make DEBUG=1    # Enables debugging mode\n\u003e   make STATIC=1   # Embeds K7 modules within the executable\n\u003e   make LIBTASK=1  # Embeds libtask and provides a 'yield' feature\n\u003e   make LIBNODE=1  # Embeds libnode and provides a lot of async-network libraries\n\n--\n[V8]          V8 VM, \u003chttp://code.google.com/p/v8/\u003e \n\n# EOF - vim: ts=2 sw=2 syn=kiwi et\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastien%2Fk7","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebastien%2Fk7","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastien%2Fk7/lists"}