Saleem Abdulrasool Profile
Saleem Abdulrasool

@compnerd

Followers
1,707
Following
62
Media
10
Statuses
701

PL/Compiler Engineer, xplat Swift, & Swift Core Team Member @ @browsercompany (ex @GoogleAI , @facebook , @Microsoft )

Joined March 2009
Don't wanna be here? Send us removal request.
Explore trending content on Musk Viewer
@compnerd
Saleem Abdulrasool
1 year
We’re dedicated to sharing our work @browsercompany - so today we’re publishing our first post on building rich native experiences on Windows with Swift & open sourcing our swift-firebase repo First up, interoperability! Windows APIs, COM, C++ and how they integrate with Swift🧵
Tweet media one
17
43
338
@compnerd
Saleem Abdulrasool
3 years
Swift is just a `winget install swift` away! #Windows10 #SwiftLang
Tweet media one
8
50
311
@compnerd
Saleem Abdulrasool
4 years
Bridging Swift to modern Windows: . You can call into the Windows Runtime from Swift - and it looks like you would expect! #Windows10 #SwiftLang
4
37
171
@compnerd
Saleem Abdulrasool
4 years
Why, yes, you can do hardware accelerated 3D graphics with Swift on Windows! A small proof-of-concept Direct3D demo application written entirely in Swift and HLSL.
Tweet media one
3
12
97
@compnerd
Saleem Abdulrasool
5 years
Reducing barriers to entry for Swift is important. Prebuilt docker images with complete toolchains, multiple SDKs, and pre-configured VSCode to help make it easier to get started at #SwiftLang #Docker
1
13
76
@compnerd
Saleem Abdulrasool
5 years
My technical talk from the 2019 @LLVM Developer Conference covering a few of the interesting technical challenges of porting Swift to Windows is up! #swift #windows
2
23
69
@compnerd
Saleem Abdulrasool
1 year
Over the next few weeks we’ll be releasing more posts on learnings that have allowed us to build Arc in Swift on Windows incl. - Our WinUI/RT bindings - How we do UI testing on Windows - and much more We’ll be sharing on along the way - see you there!
0
4
49
@compnerd
Saleem Abdulrasool
4 years
COM is the basis for so much Windows technology that it is bound to come up. demonstrates how to use COM from Swift and even how to implement a COM interface from Swift! #SwiftLang #Windows10
1
7
44
@compnerd
Saleem Abdulrasool
1 year
We’ve been working hard to stabilize Swift’s C++ interop on Windows! It hasn’t been easy but Swift’s seamless interoperability with C++ has allowed us to use dependencies like Firebase, Sentry, LaunchDarkly on non-Apple platforms Full learnings here:
Tweet media one
2
4
45
@compnerd
Saleem Abdulrasool
1 year
Alongside this, today, we're making swift-firebase public, a library that uses C++ Interop to access Firebase from Swift on non-Apple platforms! This is just the first of many as we bring more of our dependencies to Windows.
1
1
40
@compnerd
Saleem Abdulrasool
4 years
Santa is running a bit ahead of schedule: swift-crypto now builds and passes all tests on Windows! @tomerdoron @Lukasaoz #SwiftLang #Windows
2
2
33
@compnerd
Saleem Abdulrasool
5 years
The Swift core libraries have been moved to modern CMake with Swift support! Better builds for all, with support for cross-compilation and integration into existing projects. So glad that this work is done.
0
0
29
@compnerd
Saleem Abdulrasool
2 years
@joshm @browsercompany Thank you @joshm and @hursh ! So excited to be joining @browsercompany and working to build out this vision together!
0
0
23
@compnerd
Saleem Abdulrasool
5 years
swift-package-manager on Windows? #SureWhyNot Swift Package Manager running on Windows for the first time!
Tweet media one
2
3
20
@compnerd
Saleem Abdulrasool
11 months
@nicojrme @joshm I'm sure that @alexandracoding has fresher data than I do, but I'd say 80% or so. The business logic is shared, the UI code is platform specific, which also helps ensure the application feels native to the platform.
0
1
16
@compnerd
Saleem Abdulrasool
1 year
@Dimillian @hursh @browsercompany We are still pretty early, but I will leave you with this anecdote: @alexandracoding and I were pair programming and ended up deleting new code to replace with existing (shared) code, and had it just work! It’s a learning process 😅
1
0
15
@compnerd
Saleem Abdulrasool
5 years
It's turtles all the way down. Setting up PR testing CI for the CI system to build Swift for Windows/Linux/Android. 🐢🐢🐢
1
0
10
@compnerd
Saleem Abdulrasool
2 years
@slava_pestov Linearity of history is not important until it is. The linearity helps when you are trying to bisect an issue. I found that it was significantly easier to bisect LLVM than Swift precisely due to the enforced linearity.
1
0
7
@compnerd
Saleem Abdulrasool
1 year
@s1ddok @SwiftLang @JoannisOrlandos At @browsercompany , the difficult issues have been around C++ Interop, Concurrency, and build. Those fixes have been flowing back upstream. One challenge would be testing/tracking release branches (e.g. 5.10) rather than just tracking main, and small projects are great for that!
0
2
8
@compnerd
Saleem Abdulrasool
6 years
Windows Nightlies for @SwiftLang using @Microsoft @Azure !
0
0
6
@compnerd
Saleem Abdulrasool
5 years
@steipete @harlanhaskins I suppose I should point out the Swift/Win32 repository: which has seen a bit of work since the initial post, though, I have been busy with a number of other items. Patches are welcome as always :)
0
3
6
@compnerd
Saleem Abdulrasool
1 year
@s1ddok @SwiftLang @JoannisOrlandos It does feel that things are stabilizing. Projects are likely to not run into issues unless they are experimenting with the very latest features, and even then, it is often possible to workaround them.
1
0
5
@compnerd
Saleem Abdulrasool
1 year
@joseph_h_garvin @JoannisOrlandos @browsercompany is using it for building their product on Windows. We will be sharing more with the community, and do hope that others will join us on this journey.
1
0
5
@compnerd
Saleem Abdulrasool
4 years
@UINT_MIN @signalapp Congratulations @UINT_MIN ! Hopefully they won’t keep you entirely away from the Swift world :)
0
0
4
@compnerd
Saleem Abdulrasool
5 years
@vzverovich @modocache @stephentyrone @jon_roelofs Right, it does make more sense for larger projects. It’s just adding more work for the future IMO to not do it that way. But I still end up doing the same thing (single file until I get enough sketched out to split it up)
0
0
4
@compnerd
Saleem Abdulrasool
4 years
@jfbastien @pedantcoder @stephentyrone @mikeash Well, since it’s return oriented programming, the answer is clearly carriage *return* - \r. Does this mean macOS classic was right or wrong? 🤔
0
0
4
@compnerd
Saleem Abdulrasool
3 years
@jon_roelofs @Cor3ntin @AaronBallman Yeah, @AaronBallman is a pleasure to work with, both for code reviews and for discussions on how to best solve the problem.
0
0
3
@compnerd
Saleem Abdulrasool
4 years
@kastiglione Congrats! Now to prepare my list of lldb issues! 😂
1
0
4
@compnerd
Saleem Abdulrasool
3 years
@puyanlotfi @harlanhaskins Patches to build upon the SwiftUI DSL are welcome :).
0
0
3
@compnerd
Saleem Abdulrasool
1 year
@s1ddok @SwiftLang @JoannisOrlandos There are prebuilt toolchains available at . We are working to get an updated release out with the prebuilt macros support. The quickest way to build yourself currently is to follow instructions at (working on merging upstream)
1
0
4
@compnerd
Saleem Abdulrasool
4 years
0
0
4
@compnerd
Saleem Abdulrasool
4 years
@stephentyrone IMO this problem impacts llvm/clang more than others. The MSVC opt builds tend to be better debuggable than gcc which tends to be slightly better than clang’s. Not sure of others like DS5 (armcc) or don’t remember icc/OpenWatcom/etc
3
0
4
@compnerd
Saleem Abdulrasool
5 years
@johannesweiss @pwscurriculum @0xTim @uraimo @SwiftLang @Apple I’ve put in some work towards re-enabling the MSIs for the toolchain for Windows. These are now linked from the GitHub repository and available on Azure. Patches to improve the MSIs welcome :) #swift #windows #azure
1
2
4
@compnerd
Saleem Abdulrasool
5 years
@relativetoyou @llvm Too late, precompiled binaries are already available at
0
0
3
@compnerd
Saleem Abdulrasool
5 years
Thanks to @azuredev and @flowkey_com , there are builds of a Swift enabled toolchain for @ubuntu packaged into convenient @debian packages! Builds from the development tree at . #swift #linux #azure
0
4
4
@compnerd
Saleem Abdulrasool
4 years
@handleym99 That may be underestimating the importance of the underlying support that the UI actually depends on I believe. Sure, UI is what the user sees, the rest of the system is what the user depends on to “just work”.
0
0
4
@compnerd
Saleem Abdulrasool
4 years
@NovallSwift Working on OSS is way easier at Facebook - as long as the project is of an acceptable license, you can work on them with no heavyweight processes :)
0
0
2
@compnerd
Saleem Abdulrasool
4 years
@mikeash Not sure that’s what they meant by PACing pointers @mikeash !
1
0
3
@compnerd
Saleem Abdulrasool
4 years
@AaronBallman @captainjey Isn't that `llvm::ErrorOr<>` or `llvm::Expected<>`?
2
0
3
@compnerd
Saleem Abdulrasool
3 years
@slava_pestov clang does have a decent static analyzer that does help catch these issues. The problem is that it’s an extra step which means that for most people it doesn’t exist :(
1
0
3
@compnerd
Saleem Abdulrasool
1 year
@bxtuakyr @browsercompany The team is still working hard on building out Arc. We cannot wait to share it with everyone, but want to make sure that it is ready! You can join the waitlist at to ensure that you don't miss it.
1
0
3
@compnerd
Saleem Abdulrasool
5 years
@Lukasaoz Not a _pipe_ dream! I see what you did there! 🤣
1
0
3
@compnerd
Saleem Abdulrasool
4 years
@JokerEph @chandlerc1024 I’ve had the same experience as well. For anything beyond the most trivial thing, I find `repo` to be significantly better (and gerrit integration is extremely convenience and nice if private review/hosting is needed).
0
0
2
@compnerd
Saleem Abdulrasool
4 years
@freak4pc My approach would be to consider CMake + Ninja for the 5.3 release builds. Oh, and if you’re looking for examples for that: :)
1
0
3
@compnerd
Saleem Abdulrasool
3 years
@nadavrot Yes, there are checks, but most of them are due to portability or due to different language standards (by the developer). They will not do any checks by default - see the swift support in cmake. The default check is that the compiler can build something.
0
0
3
@compnerd
Saleem Abdulrasool
1 year
@mohamedmansour @bartekpacia @timsneath SwiftUI is not part of the Swift project, but rather an Apple specific framework. At @browsercompany we are using Swift projections for WinUI to build the UI. We will be sharing more about that soon and hopefully will answer your questions more in depth.
0
0
3
@compnerd
Saleem Abdulrasool
4 years
@migueldeicaza @jckarter @helje5 @stephentyrone @wreimers Something which has significant benefits that are easily overlooked :)
1
0
3
@compnerd
Saleem Abdulrasool
3 years
@dgregor79 @stroughtonsmith I’ll let you in on a secret: the windows toolchain is configured to use lld by default with SPM. We don’t actually use any MSVC tools in the swift toolchain.
1
0
2
@compnerd
Saleem Abdulrasool
5 years
@harlanhaskins @steipete I think that you were thinking of this post:
1
0
3
@compnerd
Saleem Abdulrasool
4 years
@jckarter @helje5 @stephentyrone @wreimers @convention @com Oh, nothing has changed in the 20 years. It is just building upon it. The current new thing is a new layer with COM, a few new APIs, and a ton of new stuff based on that. The interop with that is fully dependent on COM.
2
0
3
@compnerd
Saleem Abdulrasool
5 years
@harlanhaskins @steipete That always seems to happen to me. Good to know I’m not alone in that!
0
0
3
@compnerd
Saleem Abdulrasool
4 years
@pedantcoder @stephentyrone @mikeash Does a vertical tab allocate more space on the stack?!
1
0
3
@compnerd
Saleem Abdulrasool
4 years
@jon_roelofs @stephentyrone @CodaFi_ You can always reminisce about the war and battle scars^W^W^W^W good times 😛
1
0
3
@compnerd
Saleem Abdulrasool
4 years
@phausler IIUC, the model between DirectX, Vulkan, and Metal is relatively similar, based on modelling modern graphics pipelines. It would be interesting to use ` @resultBuilder ` to allow mapping to the underlying implementation appropriately.
0
0
3
@compnerd
Saleem Abdulrasool
3 years
@jckarter @stephentyrone @__phantomderp Then there’s diffing binaries. Yes, I did just do that to figure out why a change broke swift_Concurrency 😩
0
0
3
@compnerd
Saleem Abdulrasool
5 years
@stephentyrone @vzverovich @jon_roelofs @modocache That’s due to user of old cmake patterns (including in the swift repository) that need to be rooted. Use of target_sources should alleviate the conflicts due to internal changes.
0
0
3
@compnerd
Saleem Abdulrasool
3 years
@krzyzanowskim @migueldeicaza @MarkVillacampa @icanzilb Help is welcome! If only it were like Hogwarts - help will always be given to those that ask.
0
1
3
@compnerd
Saleem Abdulrasool
4 years
@dancherp @typesanitizer @CodaFi_ @UINT_MIN @DaveAbrahams @jckarter @dgregor79 @slava_pestov @pathofshrines @graydon_pub My unjustified, subjective opinion is that it is understood. K is an example of this - term rewriting defining semantics. Composable architecture is "newer"; one of the key insights in LLVM. Parsing/lexing is emphasized because of ease, because compilers are complex.
3
0
3
@compnerd
Saleem Abdulrasool
5 years
0
0
3
@compnerd
Saleem Abdulrasool
5 years
@UINT_MIN @cutculus Time to introduce the curiously recursive genetic parameter 😂
0
0
3
@compnerd
Saleem Abdulrasool
4 years
@jckarter Do I dare to ask what you are trying to do?
0
0
3
@compnerd
Saleem Abdulrasool
4 years
@MalwareMinigun There’s an interesting other side though: ninja’s clean is useful with CMake because it can avoid unnecessary reconfiguration.
0
0
2
@compnerd
Saleem Abdulrasool
3 years
@slava_pestov @slava_pestov - you forgot: There are dragons in the compiler. 😢
0
1
2
@compnerd
Saleem Abdulrasool
5 years
@jckarter @UINT_MIN Also, the version that doesn't work! Order of evaluation for arguments is unspecified ;-)
1
0
2
@compnerd
Saleem Abdulrasool
7 years
nbjoerg: you shouldn't hate JS with a passion; you should hate it with a flame thrower
0
0
2
@compnerd
Saleem Abdulrasool
5 years
@inthehands @millenomi There has been some regression recently, but slowly clawing the way back. I would love to get your input on what is missing from the current Windows support.
1
0
2
@compnerd
Saleem Abdulrasool
5 years
@jon_roelofs @stephentyrone @modocache @vzverovich I think it’s less about defaults being poor or not and more about explicit vs implicit and flexibility in structure.
0
0
2
@compnerd
Saleem Abdulrasool
4 years
@freak4pc @SwiftLang SourceKit-LSP on Windows still needs more work. I am working on getting directory watching merged into for windows to enable some of the indexing. It’s not yet integrated into the toolchain. Patches and help welcome ;)
0
0
2
@compnerd
Saleem Abdulrasool
7 years
zturner: If you're using posix, you're already not writing a portable application
0
0
2
@compnerd
Saleem Abdulrasool
4 years
@gparker @jckarter Sadly, that distinction is often lost on people. I find that making the distinction explicit to be extremely helpful in order to more easily diagnose issues.
0
0
2
@compnerd
Saleem Abdulrasool
3 years
@biozal @stroughtonsmith WinRT and WinUI _are_ COM based under the hood. My intentions for Swift/Win32 was to use XAML islands to bridge WinUI into Swift/Win32. pushed enough pieces into place where this *can* be done in pure Swift (see )
0
0
1
@compnerd
Saleem Abdulrasool
3 years
@chandlerc1024 @mdprice I’ve always disliked the `git blame`. I used to use `git annotate` until I forced myself to use blame consistently as there were subtle differences in what the two tools could actually do (though that may have been a bug, and this was years ago).
0
0
2
@compnerd
Saleem Abdulrasool
4 years
@helje5 @stephentyrone @wreimers @jckarter @convention Human generated at the moment, but should be possible to automate via ITypeComp - or better yet - the swift compiler reading the UUID and mapping that to the com interface declaration in the clang importer.
1
0
2
@compnerd
Saleem Abdulrasool
5 years
@inthehands @millenomi By all means, I'm happy to see more people experiment with this.
0
0
2
@compnerd
Saleem Abdulrasool
1 year
@jon_roelofs @vector_of_bool As @DougMerritt already pointed out PD is complicated. Google disallowed (at least from memory, need to find the public version of the internal doc) it and a number of similar licenses due to legal ambiguity.
0
0
2
@compnerd
Saleem Abdulrasool
5 years
@relativetoyou @llvm @relativetoyou - the link is the recording of the talk. The work is already in the tree :)
1
0
2
@compnerd
Saleem Abdulrasool
3 years
@thegreatbeanz Good luck on the next chapter!
0
0
2
@compnerd
Saleem Abdulrasool
4 years
@davezarzycki @pedantcoder Well, Windows is more POSIX than Linux so ... (Yes, I've grown to generally dislike POSIX :-( ).
0
0
1
@compnerd
Saleem Abdulrasool
3 years
@jfbastien Not exactly what you’re asking for, but my favorite similar thing was the ObjC ARC optimization in LLVM. There were cases where the ARC contraction code would overflow the counts and fail by asserting.
0
0
2
@compnerd
Saleem Abdulrasool
4 years
@helje5 @jckarter @stephentyrone @wreimers @convention @com I’ll just point out the following tweet. Building upon existing technology is what our industry does - standing on the shoulders of giants that came before us.
1
0
2
@compnerd
Saleem Abdulrasool
4 years
@handleym99 I meant for the API surface - `Windows.System.Profile.SystemIdentification.GetSystemIdForPublisher()`. This is after all bridging the entire System API surface - UI is but a tiny fragment off to the side.
1
0
2
@compnerd
Saleem Abdulrasool
4 years
@jckarter @helje5 @stephentyrone @wreimers @convention @com That was the reason that I started experimenting with Swift/COM ()- it opens a wide expanse of the system. The path from that to say WinUI is paved by Swift/WinMD ()
0
0
2
@compnerd
Saleem Abdulrasool
5 years
@barrelshifter Well, you’ve left out swift, the swift core libraries, and the swift tooling. Please resume fetching the sources 😛
0
0
2
@compnerd
Saleem Abdulrasool
4 years
@amonshiz @nadrees When I have >1 commit on a PR, its 1 commit and a series of typos or other corrections. For GH, "rebase and merge" and "squash and merge" are the only options I like. Linearity of history is very convenient.
2
0
2
@compnerd
Saleem Abdulrasool
4 years
@dancherp @typesanitizer @CodaFi_ @UINT_MIN @DaveAbrahams @jckarter @dgregor79 @slava_pestov @pathofshrines @graydon_pub Of course that might also be because of @RosuGrigore exploring programing languages through term rewriting in his courses, which I was fortunate enough to take at UIUC.
0
0
2
@compnerd
Saleem Abdulrasool
5 years
@AlexBBrown @UINT_MIN `xcodebuild -showsdks` should list all the available SDKs
1
0
2
@compnerd
Saleem Abdulrasool
5 years
@UINT_MIN I would have said, Swift! But, CMaki is still amusing :-)
0
0
2
@compnerd
Saleem Abdulrasool
4 years
@Catfish_Man That sounds suspiciously like software engineering :-p
0
0
1
@compnerd
Saleem Abdulrasool
5 years
@thomaskrajacic @0xTim @thomaskrajacic why not both? It’s a matter of perspective - you can take code written with Foundation on Linux and build for Windows or vice-versa.
0
0
2
@compnerd
Saleem Abdulrasool
6 years
@mjtsai - Win32 programming in Swift? Sure, why not! (warning: still contains sharp corners) -
Tweet media one
0
0
2
@compnerd
Saleem Abdulrasool
4 years
@freak4pc Yes, adding “-c release” should do the trick for that. And you’re welcome :)
1
0
2
@compnerd
Saleem Abdulrasool
4 years
@freak4pc @SwiftLang Unicode support requires that you opt-into it. Running `chcp 65001` in cmd should enable Unicode.
1
0
2
@compnerd
Saleem Abdulrasool
5 years
@stephentyrone @vzverovich @jon_roelofs @modocache @stephentyrone I think that the difference is that with cmake you enumerate your sources so you can see what’s being included, and with s-p-m there’s implicit behavior. It’s the implicit vs. explicit debate.
2
0
2