pankraty / nobox Goto Github PK
View Code? Open in Web Editor NEWA C# library aimed to operate with different primitive types with no boxing
License: MIT License
A C# library aimed to operate with different primitive types with no boxing
License: MIT License
decimal
, DateTimeOffset
, and Guid
are the only three of the supported simple types that occupy 16 bytes. All the others are 8 bytes at max.
At the same time, there are a plenty cases when the support of that types is not needed (the simplest example - in Excel cells decimal
would become double
and Guid
would be formatted to string). Therefore, we can save 8 bytes per instance (and increase performance a little) by providing shorted types (e.g. ShortSimpleValue
and ShortSimpleValueOr<T>
).
They must be convertible to and from SimpleValue
and SimpleValueOr<T>
.
With only two types (SimpleValue
and SimpleValueOr<T>
) there are already lots of copy-pasted code, especially, in tests. Structures cannot be inherited, and we are not able to cast value types to generic type-arguments, so easy ways to avoid code duplication do not fit.
Need to investigate is it possible to use dynamics
(in tests, not in code) or T4 templates.
May add another value type SimpleValueType.Enum
that will be stored in either _longValue
or _ulongValue
field, depending on the underlying type. The information about the original type will be lost but at least the value will be preserved.
SimpleValue
and SimpleValueOr<T>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.