Ugur Toprakdeviren (@toprakrun) header
Ugur Toprakdeviren (@toprakrun) profile picture

Building MiniSwift. Write and run SwiftUI in any browser.

Istanbul
Joined June 2026
Photo by Ugur Toprakdeviren (@toprakrun)Photo by Ugur Toprakdeviren (@toprakrun)Photo by Ugur Toprakdeviren (@toprakrun)Photo by Ugur Toprakdeviren (@toprakrun)Photo by Ugur Toprakdeviren (@toprakrun)Photo by Ugur Toprakdeviren (@toprakrun)Photo by Ugur Toprakdeviren (@toprakrun)Photo by Ugur Toprakdeviren (@toprakrun)Photo by Ugur Toprakdeviren (@toprakrun)Photo by Ugur Toprakdeviren (@toprakrun)
WritingI had run a pilot experiment with Mojo on kavak[dot]run. I think what Grok is missing is that Mojo's similarity to Python is in its syntax, not its semantics. My pilot experiment with Mojo on kavak demonstrated this quite concretely. In Mojo, Int is 64-bit. In Python, 2**100 works just fine; in Mojo, it overflows. So the first trade-off of being "as easy as Python" seems to be giving up Python's semantics.The performance comes from fn, struct, and static typing. These are features of a language that looks like Python but isn't Python. ASAP destruction (where a value is destroyed as soon as it's last used) is part of the ownership model. That's where Rust's learning curve comes back in a different disguise. My impression is that Mojo doesn't quite solve these kinds of problems yet. Instead, it seems to let the programmer choose where they want to stand on the spectrum when dealing with these trade-offs.
Replying to @Shra_va_ni
Not impossible, just fundamentally hard. Python’s ease comes from dynamic typing and GC, which cost speed and make airtight static safety expensive. C gives raw speed via full control, at the price of footguns. Rust adds compile-time memory/thread safety without GC, but the ownership rules create the learning curve. Mojo is the closest active attempt: Python-like syntax, systems-level speed, and Rust-inspired safety features. The research keeps closing the gap; the pure triple still requires solving deep tensions in type systems and abstraction costs.
77
Could we significantly reduce the amount of training data a neural network needs to learn a particular domain by explicitly providing it with the rules and representational structure of a language, rather than relying on the approach used by LLMs?
1
22
The ilmek library, which I built in sml.chat/ with a focus on clean API design and separation of responsibilities, keeps things this simple on the surface, while hiding quite a lot under the hood. It brings together Seaseme, X3DH, Post-Quantum ML-KEM, X25519, KEM-768, XChaCha20-Poly1305, and much more. And for the libSML library that uses it, all you need to do is call ilmek.send ;-)
95
Fine, I get collecting telemetry (although that alone raises a whole bunch of questions), but seriously, where did you get the audacity to read another app’s directory in the first place?
46
I trained an LLM from scratch on Metal and ran a little experiment with 19th-century books as a smoke test. With just 7 million parameters and 2,000 steps in 57 seconds, the model came up with this sentence: "…I had been a little man to be as if he was in the most great world…" And just like that, it started having an existential crisis. 😀 Anyway, I guess we shouldn't read too much into AI. At the end of the day, it's just a program predicting the next token. 😀
1
2
189
One of the keys to writing bug-free code is to use code generation wherever possible and automate as much of the code as you can.
46
The Hard Problems in Compiler Design How should you approach processing all the files in a project through the lexer, parser, and semantic analyzer? Should the lexer and parser process each file independently and quickly, then pass the results to the semantic analyzer through an event-based architecture? If we go with this approach, how should we analyze dependencies between files that haven't reached the semantic analysis stage yet? On the other hand, if we process everything sequentially, what should happen when a semantic error is found? Should the compiler be notified immediately that the project cannot be compiled, while semantic analysis continues in the background? Or should it stop as soon as it encounters an error and let another background process analyze the remaining files? And here's another interesting scenario: What if the user fixes that error while the analysis is still running? How should the semantic analyzer react to those changes? How can it detect them and update its analysis accordingly? There are so many similar scenarios and edge cases that you could come up with. Now I understand much better why Xcode sometimes exhibits such strange behavior when there's an error somewhere in the project. Compiler design is full of these kinds of challenges. There isn't a single right approach. Every architectural decision comes with its own trade-offs, and each choice leads to a different set of consequences.
1
94
The Lexer recognizes, the Parser structures, and the Semantic Analyzer interprets.
2
65
Swift doesn't normalize Unicode during the lexer phase, so the syntax below is actually valid ;-) But when it comes to Strings, Swift uses canonical equivalence, meaning these two are considered equal at runtime. Quite an interesting little quirk of the language!
4
249
The joys of writing a Swift compiler from scratch.
2
194
While browsing the FreeBSD source code, I came across this comment 😀 I think this file should be called developer_diary.c rather than calendar.c. ;-)
1
147
Programming languages are basically generic libraries. Interesting. ;-)
81
Miniswift is coming with a very big update. It has successfully implemented the Foundation library. It generated 6.8 million lines of working codegen C code.
3
2
26
1,728
I tested the C file generated by CodeGen against Apple’s implementation and confirmed that the output is byte-for-byte identical. Of course, I also managed to uncover a few bugs in Apple’s code along the way. ;-)
140
The strangest bug in Xcode: Invalid character in source file.
1
135
"The bearing of a child takes nine months, no matter how many women are assigned." — Fred Brooks, 1975 "Nine AI agents can't write a fully working Swift compiler in one month either." — The Mythical Agent-Month, 2026
65
Hey Claude, I need a small favor. Write me a Swift compiler that runs entirely in the browser. From scratch, obviously. Lexer, Parser, AST, Semantic Analysis, IR, code generation. The whole thing. Full Swift 6.4 support. Generics, protocol conformances, associated types, parameter packs, actors, ownership, ARC, concurrency, SwiftUI, Foundation. Everything. No bugs. No regressions. No fallbacks. No fake types. No silent errors. No TODOs. No "we can implement this later." Also, don't use the official Swift compiler. That would be cheating. Keep it lightweight, preferably under 1 MB. Make it fast, clean, maintainable, and production-ready. And please, don't give me a 150-phase implementation plan. Just implement it. You have plenty of context left. Thanks, buddy. ❤
2
1
15
1,108
Jensen @JensenHuang said ChatGPT Astra was AGI. Maybe @nvidia should just put the Astra model in as the new CEO then. That way we can actually see if they stand behind their own words. Would make for a pretty fun experiment, we’d all get a good laugh out of it.
89
I mean, couldn't you be a little less obvious about it? :D :D :D I couldn't even type because I was laughing so hard! :D
Unfair that CEOs who aren’t into Asian girls get fewer dating options from spy agencies. Where are the French/Russian/Iranian honeypots? Not one spy girl sent my way. Are they even trying? France is excused — their decision-makers aren’t into girls. Everyone else: try harder!
1
174
It would be really interesting if browsers allowed us to fork the JavaScript runtime at an arbitrary point in time. This could make it possible to make an environment where developers can experiment with different scenarios and simulate alternative outcomes without affecting the original execution state.
1
87