-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
286 lines (275 loc) · 12.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/pico.min.css">
<link rel="stylesheet" href="custom.css">
<script async defer src="buttons.js"></script>
<meta property="og:title" content="bflat - C# as you know it but with Go-inspired tooling">
<meta property="og:description" content="Build tiny, selfcontained, and native executables with C#">
<meta property="og:type" content="website">
<meta property="og:image" content="https://flattened.net/assets/opengraph.png">
<title>bflat - C# as you know it but with Go-inspired tooling (small, selfcontained, and native executables)</title>
</head>
<body>
<!-- Hero -->
<div class="hero" data-theme="dark">
<nav class="container-fluid">
<ul>
<li><a href="/~https://github.com/bflattened/bflat#readme" class="contrast">How it works</a></li>
<li><a href="https://paypal.me/MichalStrehovsky" class="contrast">Sponsor</a></li>
</ul>
<ul>
<!--li><iframe src="https://ghbtns.com/github-btn.html?user=bflattened&repo=bflat&type=star&count=true&size=large" frameborder="0" scrolling="0" width="160" height="30" title="GitHub"></iframe></li-->
<li><a class="github-button" href="/~https://github.com/bflattened/bflat" data-size="large" data-show-count="true" aria-label="Star bflattened/bflat on GitHub">Star</a></li>
</nav>
<header class="container">
<hgroup>
<h1>bflat</h1>
<h2>C# as you know it but with Go-inspired tooling</h2>
</hgroup>
<p><a href="#getstarted" role="button">Get started</a> <a href="/~https://github.com/bflattened/bflat/releases" role="button" class="secondary">Download</a></p>
<small>90 MB download with no dependencies. For Linux and Windows. MIT license.</small>
</header>
</div><!-- ./ Hero -->
<main>
<section id="platforms">
<div class="container">
<hgroup>
<h2>
Build native apps for
<svg
id="be452e83-5912-4855-80f8-a79ecab91838"
data-name="Layer 1"
xmlns="http://www.w3.org/2000/svg"
width="135"
height="50"
viewBox="0 0 135 50">
<path id='path0'>
<animate id='d0' attributeName='d' begin='0s;d3.end'
dur='2000ms' fill='remove'
values='m0,25 h0 ; m0,25 h155 ; m0,25 h155 ; m0,25 h0' keyTimes='0;0.66666666666667;0.83333333333333;1' />
</path>
<path id='path1'>
<animate id='d1' attributeName='d' begin='d0.end'
dur='2000ms' fill='remove'
values='m0,25 h0 ; m0,25 h155 ; m0,25 h155 ; m0,25 h0' keyTimes='0;0.66666666666667;0.83333333333333;1' />
</path>
<path id='path2'>
<animate id='d2' attributeName='d' begin='d1.end'
dur='2000ms' fill='remove'
values='m0,25 h0 ; m0,25 h155 ; m0,25 h155 ; m0,25 h0' keyTimes='0;0.66666666666667;0.83333333333333;1' />
</path>
<path id='path3'>
<animate id='d3' attributeName='d' begin='d2.end'
dur='2000ms' fill='remove'
values='m0,25 h0 ; m0,25 h155 ; m0,25 h155 ; m0,25 h0' keyTimes='0;0.66666666666667;0.83333333333333;1' />
</path>
<text font-family='monospace'
x='0%' dominant-baseline='middle' text-anchor='start'>
<textPath xlink:href='#path0'>Linux</textPath>
</text>
<text font-family='monospace'
x='0%' dominant-baseline='middle' text-anchor='start'>
<textPath xlink:href='#path1'>Windows</textPath>
</text>
<text font-family='monospace'
x='0%' dominant-baseline='middle' text-anchor='start'>
<textPath xlink:href='#path2'>Android</textPath>
</text>
<text font-family='monospace'
x='0%' dominant-baseline='middle' text-anchor='start'>
<textPath xlink:href='#path3'>UEFI</textPath>
</text>
</svg>
</h2>
<p>bflat is a native compiler for C# that comes with everything you need to build C# apps for any of the supported platforms. No additional SDKs or NDKs needed.</p>
</hgroup>
</div>
</section>
<section id="fundamentals">
<div class="container">
<div class="grid">
<div>
<hgroup>
<h4>Battle-tested fundamentals</h4>
<p>Based on parts of the .NET 8 SDK that is trusted by developers all around the world, but reimagined as native-first and stripped to the bare minimum needed to build native apps with C#. Based on CoreCLR's code generator and GC.</p>
</hgroup>
</div>
<div>
<hgroup>
<h4>Choose your standard library</h4>
<p>Comes with two standard libraries: one (DotNet) that is compatible with .NET and supports everything from console to JSON, and another (Zero) that is stripped to bare minimum and doesn't even have a GC.</p>
</hgroup>
</div>
<div>
<hgroup>
<h4>Build native apps or shared libraries</h4>
<p>Produce native apps and native libraries. Consume C# libraries built with bflat from other languages using their respective FFI interface.</p>
</hgroup>
</div>
<div>
<hgroup>
<h4>Bring your own build system</h4>
<p>Invoke bflat directly from terminal, integrate with a shell script, Makefile, or even MSBuild. The choice is yours.</p>
</hgroup>
</div>
</div>
</div>
</section>
<section id="platforms">
<div class="container">
<center><embed src="assets/hello.svg" width="70%"></center>
</div>
</section>
<section id="platforms">
<div class="container">
<hgroup>
<h2>Standard libraries supported by bflat at a glance</h2>
<p>
<table role="grid">
<thead>
<tr>
<td> </td>
<td>DotNet</td>
<td>Zero</td>
</tr>
</thead>
<tbody>
<tr>
<td>Primitive types</td>
<td>✓</td>
<td>✓</td>
</tr>
<tr>
<td>Rich standard library</td>
<td>✓</td>
<td>✗</td>
</tr>
<tr>
<td>Marshalling-less p/invoke</td>
<td>✓</td>
<td>✓</td>
</tr>
<tr>
<td>Full p/invoke</td>
<td>✓</td>
<td>✗</td>
</tr>
<tr>
<td>Garbage collector</td>
<td>✓</td>
<td>✗</td>
</tr>
<tr>
<td>Exception handling</td>
<td>✓</td>
<td>✗</td>
</tr>
<tr>
<td>Building apps and libraries</td>
<td>✓</td>
<td>✓</td>
</tr>
<tr>
<td>Target Linux, Windows, Android</td>
<td>✓</td>
<td>✓</td>
</tr>
<tr>
<td>Target UEFI</td>
<td>✗</td>
<td>✓</td>
</tr>
<tr>
<td>Starting app size</td>
<td>600 kB</td>
<td>4 kB</td>
</tr>
</tbody>
</table>
</p>
</hgroup>
</div>
</section>
<section id="platforms">
<div class="container">
<hgroup>
<h2>Run C# with no operating system, on bare metal</h2>
<p><center><img src="assets/uefi.gif" width="70%"></center></p>
</hgroup>
</div>
</section>
<section id="platforms">
<div class="container">
<hgroup>
<h2>Build native code or .NET bytecode</h2>
<p><center><embed src="assets/buildil.svg" width="70%"></center></p>
</hgroup>
</div>
</section>
<section id="platforms">
<a name="getstarted"></a>
<div class="container">
<hgroup>
<h2>Get started</h2>
<p>Download and unpack <a href="/~https://github.com/bflattened/bflat/releases">a release</a>, optionally place it on your PATH and look at some <a href="/~https://github.com/bflattened/bflat/tree/master/samples">samples</a></p>
<p>If you're on Windows, you can also get bflat from winget: `winget install bflat`.</p>
</hgroup>
</div>
</section>
<section id="help">
<div class="container">
<pre>
$ bflat build --help
Description:
Compiles the specified C# source files into native code
Usage:
bflat build [<>...] [options]
Arguments:
<file list>
Options:
-d, --define <define> Define conditional compilation symbol(s)
-r, --reference <file list> Additional .NET assemblies to include
--target <Exe|Shared|WinExe> Build target
-o, --out <file> Output file path
-c Produce object file, but don't run linker
--ldflags <ldflags> Arguments to pass to the linker
-x Print the commands
--arch <x86|x64|arm64> Target architecture
--os <linux|windows|uefi> Target operating system
-m <{isa1}[,{isaN}]|native> Target instruction set extensions
--libc <libc> Target libc (Windows: shcrt|none, Linux: glibc|bionic)
-Os, --optimize-space Favor code space when optimizing
-Ot, --optimize-time Favor code speed when optimizing
-O0, --no-optimization Disable optimizations
--no-reflection Disable support for reflection
--no-stacktrace-data Disable support for textual stack traces
--no-globalization Disable support for globalization (use invariant mode)
--no-exception-messages Disable exception messages
--no-pie Do not generate position independent executable
--separate-symbols Separate debugging symbols (Linux)
--no-debug-info Disable generation of debug information
--map <file> Generate an object map file
--mstat Produce MSTAT and DGML files for size analysis
-i <library|library!function> Bind to entrypoint statically
--feature <Feature=[true|false]> Set feature switch value
-res, --resource <<file>[,<name>[,public|private]]> Managed resource to include
--stdlib <DotNet|None|Zero> C# standard library to use
--deterministic Produce deterministic outputs including timestamps
--verbose Enable verbose logging
--langversion <langversion> C# language version ('latest', 'default', 'latestmajor',
'preview', or version like '6' or '7.1'
-?, -h, --help Show help and usage information
</pre>
</div>
</section>
</main>
<footer>
<div class="container">
<small>Made by <a href="https://twitter.com/MStrehovsky">Michal Strehovský</a> • <a href="/~https://github.com/bflattened/bflat">GitHub</a></small>
</div>
</footer>
</body>
</html>