This project adheres to Semantic Versioning.
Fin is very experimental right now! I wouldn't recommend using it for anything other than for exploration and toy examples right now.
We will occasionally make changes to fin
that may affect your projects.
You can easily find changes by searching for "### Change"
in this markdown file.
## [some_version]
### Added
### Fixed
### Fixed (minor, major, ...)
### Changed
### Changed (BREAKING-CHANGES, minor, ...)
Test/interim releases are not documented here.
- Add
[c_const]
attribute for classes, fields and parameters - Add C# docstring to nugget package
- Fix
in
parameter modifier for reference types
- Transpiler - won't allow fields of type
c_array_sized<T>
orc_array<T>
to be declared with[mem]
attribute. Also won't allow primitives likeu8
orint
to be declared with[mem]
attribute. - Transpiler - won't allow parameters of type
c_array_sized<T>
as C standard makes arrays likeuint8_t data[5]
decay to pointers likeuint8_t * data
when used as a function parameter.
- Fix
[mem]
field needs to decay to pointer
- not a breaking change, but now generated constructors return a pointer to the object instead of void.
- this allows more natural translations of C# to C
- add support for allocating objects on the stack
- fix multiple variable declarations in a single line
- used to not work for reference types
- #24
- fix delegate and pointer type parameters
- add duplicate include statements after fin type is resolved to c header file
- we had files with multiple
#include <stdint.h>
statements because fin types like u8, u16, etc. all resolved to#include <stdint.h>
.
- we had files with multiple
- Add
c_array_mem<T>
- math mode defaults to
unsafe mode
for now.
- mem - return pointer to mem object; get pointer of mem object on assignment
- Add initial support for delegates
- for now, delegates must be defined inside a fin class
- #77
- Add default constructor if missing
- Add wrapping add/sub/mul methods
- Add support for fin numerics MIN, MAX constants like u8.MAX
- skip creating blank .c files for Plain Old Data (POD) type structures
- Relaxed type requirements on
IMangledNameProvider.FromFinType<T>
- Moved
MangledNameProvider.FromFinType<T>
intoIMangledNameProvider
interface
- Add
IMangledNameProvider
- Useful for additional user template based code generation
- Add StringUtils indent functions
- Renamed
finlang.Transpiler.Transpiler
tofinlang.Transpiler.CTranspiler
to avoid name conflicts between namespace and class. - change private methods to be
static
without module prefix
- Transpiler - Interface conversion functions change: MCL and MAA macros.
- Transpiler - option to specify FFI port implementation header file
- It also defaults to
_ffi.h
isntead of_port_implementation.h
- #69
- It also defaults to
- Transpiler - fix #57 Generated vtable variable name should be different per file generated
- Transpiler - only transpile interfaces that have IFinObj as an ancestor
- Transpiler - allow environment variables to specify which type transpiler should focus on
- Transpiler - fix #58 incorrect vtable method return type for pointer to object
- Transpiler - support constant fields for numbers
- Transpiler - support
[simonly]
attribute on fields - Transpiler - initial support for
sizeof()
like functionality - Transpiler - initial style support for indent and line endings
- Transpiler - fix
FinC.ignore_unused(this)
- Transpiler - fix interface generation for non-bool types
- Transpiler - output
Source file
header info using Linux path separators - Transpiler - generated line endings now use style settings which default to Environment.NewLine.
- Transpiler - initial support for a field to be an actual class object type and not just a pointer to it.
- field:
[mem] public SomeObj obj;
- field:
- Transpiler - initial support for
c_array_sized<T>
.- ex:
[mem] c_array_sized<u8> data = mem.init(new c_array_sized<u8>(5));
- Currently only supports fields (not local variables).
- Doesn't need
[mem]
because it is implied. You can add it though.
- ex:
- Transpiler - add ability to customize the output file path and name
- See
transpiler.SetFileNamer()
for more details.
- See
- Transpiler - add default options to output finlang version, date/time, and MD5 filepath.
- Also outputs source file path.
- See
transpiler.Options
for more details.
- Transpiler - support
SimOnly.run(() => { /* code */ })
for running code in simulation mode only.- This code can be in constructors, or local methods...
- Transpiler - support C# binary/hex literals with underscore separators
0b1010_1110
-->0b10101110
0x1234_5678
-->0x12345678
- Transpiler - initial support for C# ref and out parameters of primitives
- Transpiler - initial support for C# in parameters of primitives
- Transpiler - initial support for field declaration initial values.
- Transpiler - support constructing field mem objects
- Transpiler - type override for fields and parameters
- Transpiler - support
FinC.EchoToC("some code")
- Transpiler - support [add_include("some_include")] attribute on classes
- Transpiler - initial support for interfaces
- interface inheritance, multiple interfaces, interface conversions...
- Transpiler - allow generating C to ignore unused warning:
FinC.ignore_unused(some_var)
- Transpiler - support FFI on classes that implement interfaces
- Transpiler - support FFI on specific methods
- Transpiler - now tracks header dependency of type
T
contained inc_array<T>
- Transpiler - fix pass
self
to method calls likethis.toggle()
- Transpiler - prevent .h file from including itself in the same file
- Transpiler - support nested classes/enums although indentation is not correct yet
- Transpiler - handle an object calling its own method without
this
liketoggle()
- Transpiler - allow nullable types like
Led?
, convertnull
toNULL
- Transpiler - ignore
required
,virtual
,override
,sealed
,in
- Transpiler - private methods are prefixed with
PRIVATE_
- Transpiler - fix
c_array
of reference types
- Transpiler - support enumerations
- They can't be nested inside a class yet.
- Transpiler - support fin numeric
wrap_lshift()
- ex:
(my_u8 + 10).wrap_lshift(i + 2)
-->(uint8_t)((my_u8 + 10) << (i + 2))
- ex:
- Transpiler - support narrowing casts.
- ex:
b = (u8)my_i32;
-->b = (uint8_t)my_i32;
- ex:
- Transpiler - support
u8.narrow_from(some_arg)
- ex:
u8.narrow_from(my_i32)
-->(uint8_t)my_i32
- ex:
- Transpiler - support c style naked arrays
c_array<T>
- Improve 1-1 transpilation of fin to C99
- removed indentation from C# and other small improvements
- Moved Transpiler into main finlang nuget package
transpiler.GetListOfAllGeneratedFiles()
- Transpiler supports XML doc comments
///<summary>...</summary
- fix ambiguous cast between fin types
- [ffi] attribute for c# classes (foreign function interface)
- integer self type declaration like
my_u16.u16_
narrow_to_x()
methods likeu32.narrow_to_u8()
narrow_from()
methods likeu8.narrow_from_u32()
- casting a C# int type to a fin type now uses a narrowing (checked) conversion.
- removed wrapping methods from signed types for now (C implementation defined behavior).
Still only simulating in C#. Not generating C99 yet.
c_array<T>
naked C style array (no length)- fin integer types
u8
,u16
,u32
,u64
,i8
,i16
,i32
,i64
with most operators overloaded - math unsafe mode and user error provided mode
- Err object for handling errors
- detects if not checked and cleared when going out of scope
mem.stack()
andmem.heap()
for allocating memory