Chaos is a purely functional programming language that achieves zero cyclomatic complexity.
Also, I'm sitting on this branch: https://github.com/chaos-lang/fs/tree/rename
I don't want to merge it before I get a test in. How do we go about testing?
fs
spell seems to be a bit more of the os
/sys
Python modules. At least in intent.
fs
API currently supports: read()
, copy()
, and soon-to-be rename()
, all related to files.
Morning @mertyildiran. Question: do you prefer squash merging?
I prefer linear history with as little squash and merge commits as possible because of this email of Linus: https://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg39091.html
If something really needs a squash then at list this method should be used: https://stackoverflow.com/a/5190323/2104879
Oh! It's the 1 year birthday of Chaos, correct?
I didn't know that today is the birthday of Chaos :smile: How did you determine that? Looked at the first ever commit?
Also, I'm sitting on this branch: https://github.com/chaos-lang/fs/tree/rename
I don't want to merge it before I get a test in. How do we go about testing?
I expect to have tests for each functions in the library in https://github.com/chaos-lang/fs/blob/44329743f33953dcb51cb6a65f6b1deaad0f8f2c/test.kaos
I also just had a thought: the new
fs
spell was supposed to be for filesystems, but it so far seems to only be manipulating files. Question: should we change this to thefile
orfileutils
spell?
Python's modules related to file manipulation is a little bit messy. They've introduced more modules and kept the old modules along the way for the sake of backward compatibility. Since even the core modules requires separate installation procedure in Chaos, if we split the modules then it might become a little bit inconvenient to use them. I would go with a relatively big module that covers everything related to filesystem. fs
is a good name for such a module I think.
os
module to retrieve operating system's kernel name/version and distro name/version etc. We can have modules like linux
, windows
and macos
to provide OS-specific functionality if it's really needed.
The
fs
API currently supports:read()
,copy()
, and soon-to-berename()
, all related to files.
If rename()
function is able to do more than just file renaming like changing the path then I think move()
name is more suitable.
fs
.
str file_pointer = fs.open(some_path)
but it would be a bad approach.
byte
to the language and it will be prefixed with an integer like 1 byte
, 2 byte
etc. So that we can have the file pointer like 1 byte file_pointer = fs.open(some_path)
.
DD
, DB
, DW
, DQ
, DT
just like how it's in Assembly. But I think 1 byte
is cooler.
sys_open
syscall returns a file descriptor but in its essence it's a 1 byte pointer as far as I understand from this Assembly code example for file operations. I might be wrong though.
lexer.l
parser.y
enum ASTNodeType
in ast.h
and char *ast_node_type_names[]
in ast.c
union Value
in symbol.h
ast.c
and use them in parser.y
symbol.c
function.c
case
statements into interpreter.c
for the AST node types that you've introduced.case
statements into compiler.c
for the AST node types that you've introduced.Chaos.c
to provide an API to Chaos C extensions for the new data type.1 byte
, 2 byte
syntax to see how possible it's.
the bitwise operators are also valid for integers in C
Great
FILE*
but after finding that you'll essentially add it to this union
to have a new data type.