Update readme

This commit is contained in:
bumbread 2022-06-26 15:39:15 +11:00
parent c2cc9e5129
commit 8f67e3a6ce
3 changed files with 31 additions and 65 deletions

View File

@ -1,31 +0,0 @@
local lake = require 'lakebuild'
-- NOTE(bumbread): change this to reflect the fact that
-- now platform-independent stuff is in src/code and
-- platform-dependent stuff is in src/$PALTFORM
local function buildcmd(target)
local deps = ""
if target.userdata.add_deps then
deps = table.concat(target.deps, " ")
end
local buildline = table.concat({"clang", target.userdata.flags, target.files[1], "-o", target.name, deps}, " ")
print(buildline)
os.execute(buildline)
end
-- build all loose C files other than main.c into object files
local files = lake.glob_combined(".", false, nil, function(_, n) return lake.endswith(n, ".c") and not lake.endswith(n, "main.c") end)
local objects = {}
for _,file in ipairs(files) do
local name = file[1] .. '.o'
lake:add_target(name, {file[2]}, buildcmd, {flags="-c", add_deps=false})
table.insert(objects, name)
end
-- build main.c
lake:add_chain("main.exe", {"main.c"}, objects, buildcmd, {flags="-O2", add_deps=true})
lake:request_build("main.exe")

60
readme
View File

@ -1,41 +1,43 @@
ABOUT
Ciabatta - An implementation of CRT for x86-64 windows and linux platforms.
The goal is to provide a platform-independent CRT with the purpose of
explicitly defining some of platform-defined behaviours in order to simplify
the development and providing additional functionality to aid the developers in
writing cross-platform applications.
Ciabatta - An implementation of CRT for x86-64 windows and linux platforms.
What are the advantages over using your default CRT? I dunno but you can if you
want. I haven't ran any benchmarks or verified compliance yet, so use at your
own risk. Some functionality is way more sexier than your normal-ass CRT tho,
so you might consider switching.
Note that Undefined Behaviour is impossible to define on a CRT level, since the
semantics of the language can only be changed at the compiler level. Sometimes
the compilers will replace CRT function calls with builtin functions, which is
meant as an optimization, e.g. replacing some forms of prinf() with puts() or
replacing strlen with an x86 rep movsb instruction. Even if ciabatta does have
a specific behaviour under given UB conditions, that behaviour is not
guaranteed.
The goals:
- Providing API for sockets, unicode processing (not just encodings), maybe
the support for common image and data file formats and other useful
non-standard functionality.
- Making it easy to port the library to a new platform, e.g. a custom OS
kernel or a different processor architecture.
- Defining implementation-defined behaviours of some of the functions and
explicitly documenting them.
- Make it reasonably fast compared to MSVCRT and GLIBC.
PLATFORM SUPPORT
OS/Kernel:
- Windows (64-bit)
- TODO: Linux
Processor Architecture
- x86-64
USAGE
In order to build the library you need to have clang installed. Download the
source code, then run bake.cmd. Copy `ciabatta.lib` to a good place in your
project.
Don't forget to include ciabatta's include directory:
/I inc (MSVC CL)
-I inc (Clang)
For MSVC LINK add the following arguments:
/nodefaultlibs
ciabatta.lib
kernel32.lib
user32.lib
shell32.lib
Link flags for average copy-paste enjoyers:
/nodefaultlibs ciabatta.lib kernel32.lib user32.lib shell32.lib
(TODO: usage for clang)
(TODO)
CONTRIBUTING
Pull requests are always welcome.
Pull requests are always welcome.
LICENCE
TBD
TBD, but probably i'll make it MIT or WTFPL :kekw:

5
todo
View File

@ -40,15 +40,10 @@ stdlib.h:
Probably other stuff
threads.h:
Make _Thread_local work on windows
Verify the mtx_recursive goes ok. Also change win_stdio.c accordingly.
TODO: add todo items
tgmath.h:
Basically everything
uchar.h:
Basically everything
wchar.h:
Basically everything