Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
tinkersleep
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
Ukaliq Script
(theiling.de)
2 points
by
tinkersleep
3y ago
|
0 comments
2.
▲
by
tinkersleep
5y ago
You are right, it was a poor decision. The format is not C compatible, and using the same sigil is dangerous when switching and this library's format is passed to standard printf. This started out as a drop-in replacement, but it isn
3.
▲
by
tinkersleep
5y ago
OK, yes, good idea.
4.
▲
by
tinkersleep
5y ago
There is __VA_OPT__ in C++2a, which handles recursion termination in macro expansion. This will probably be in future C, too, right? And if there was also __EVAL__ to force the macro preprocessor into another evaluation level, you could wr
5.
▲
by
tinkersleep
5y ago
Exactly! Or on Windows 64-bit, where 'long' is 32-bit and 'size_t' is 'unsigned long long'.
6.
▲
by
tinkersleep
5y ago
> - I wanted a form to register new types, so it could work for user-defined types; Yes, I had the same urge. You can easily fall into the trap of too many features on the list. I settled on keeping user types out: you can always write
7.
▲
by
tinkersleep
5y ago
Ok, thanks for the hint. I put the most important infos into the intro: you just don't need 'll', 'l', 'z' modifiers for specifying sizeof(operand), as the compiler does that via _Generic.
8.
▲
Type-Safe Printf for C
(github.com)
71 points
by
tinkersleep
5y ago
|
50 comments
9.
▲
by
tinkersleep
5y ago
Probably the 1e6th approach, but anyway, I also wanted to play with this myself: here's a _Generic and macro based approach to get printf type-safe in C. It needs C11, and uses some gcc extensions.
10.
▲
by
tinkersleep
8y ago
A monospaced 8 bit pixel font I made is 'Liquid Mean', which also aims at Unicode (with some 2400 characters). But it is available only in a weird format as a C library or an private format text file. http://www.theili
11.
▲
by
tinkersleep
8y ago
Well, yes and no. If your slice at 0.1mm with Hob3l, then slic3r can still decide that it uses 0.2mm or 0.3mm or 0.4mm slices -- it would just skip a few slices from Hob3l. I don't think there is a problem with that. It will get wei
12.
▲
by
tinkersleep
8y ago
Author here. All the common stuff (that is based on 3D CSG without extensions) works fine, and most for 3D construction operators just produce a polyhedron with a simple algorithm (e.g., linear_extrude), so that's fine, too. But some
13.
▲
by
tinkersleep
8y ago
Author here. Thank you for providing the file, I will debug it. I must admit that I spent almost no time to think about memory management, and my test files are way smaller. I guess this will be a debugging session. :-)
14.
▲
Show HN: 100x Faster Slicing of SCAD Files for 3D Printing
(github.com)
103 points
by
tinkersleep
8y ago
|
21 comments
15.
▲
Hob3l: Fast Slicing of SCAD Files for 3D Printing
(github.com)
2 points
by
tinkersleep
8y ago
|
0 comments
16.
▲
Regex Parser in C with Continuation Passing and O(1) Stack
(theiling.de)
8 points
by
tinkersleep
9y ago
|
0 comments
17.
▲
by
tinkersleep
9y ago
Thanks! It was fun tinkering. For the regex problem, because of the required backtracking, data usage is definitely not O(1), so the continuation data will not be storable on the stack for an O(1) stack tail-call-only CPS version of regex.
18.
▲
by
tinkersleep
9y ago
gcc generates 'jmp *%eax' (and other computed branch instructions) for this code, so yes, it uses tail-calls for function pointers.
19.
▲
by
tinkersleep
9y ago
You are absolutely right! But I'd like to stress that this is a problem of this implementation, but not of the CPS technique as such: CPS is just not used to its extreme here to allow for tail-call optimisation of all functions, which
20.
▲
by
tinkersleep
9y ago
Hmm, I have yet to see a trivial implementation for full-featured regex syntax, which was my goal. The idea was not to parse a simple dialect of regex, but to parse a full-featured dialect, including things like \d, \), [)] and multi-level
21.
▲
Regex Parser in C Using Continuation Passing
(theiling.de)
79 points
by
tinkersleep
9y ago
|
25 comments