8 ms·
Build a PinePhone App with Zig and Zgt
- kop316 4y agoLooking through this, I don't see anything that is Pinephone specific. Building Pinephone apps is just like building for a Linux distro with a small screen and a modem. So I am curious, what about the process was Pinephone specific?
- runjake 4y agoThe parts about deploying to the PinePhone and VSCode Remote/debugging to the PinePhone. This article is obviously a beginner's tutorial to deploying a Zig app to the PinePhone.
- kop316 4y ago> The parts about deploying to the PinePhone ??? What does "deploy to the Pinephone" mean? Ctrl+F "deploy" returns nothing. AFAIK, It looks like all of the development/coding/compiling is all done on the Pinephone over SSH, so I am not sure what makes it Pinephone specific. > VSCode Remote/debugging to the PinePhone That's just how to use SSH with VSCode? That's not Pinephone specific. > This article is obviously a beginner's tutorial to deploying a Zig app I get that, my point is aside from a small screen and a modem that can Call/send SMS, there isn't anything special about developing for the Pinephone vs. an ARM linux distribution. That's why I was curious.
- runjake 4y agoAgain, RTFA. But I don't think you're actually curious, I think you're just angry about something, when you should be moving onto the next post.
- kop316 4y agoNo, I was geniunely curious? Not sure why you are hostile.....but it isn't worth my time to figure out.
- UncleEntity 4y agoMy guess is they are showing how easy it is to make an app on the PinePhone. Not sure how useful it is to compile on the phone instead of doing a cross-compile on a “proper” dev box but I guess to just get up and running it works. Makes me want a PinePhone because I have an idea or two and have no idea how to program a simple app for my iPhone. I’d probably just use C though because I gasp like programming in C/simple C++.
- kop316 4y ago> My guess is they are showing how easy it is to make an app on the PinePhone. True, that just isn't specific to Zig, which is why I was confused. It is neat that building the GUI isn't too hard, building a GUI in C/GTK involved a lot of boilerplate and isn't easy to start. For GTK: I just end up using this: https://gitlab.com/sadiq/my-gtemplate/ https://gitlab.com/sadiq/my-gtemplate/ As my start point. > Not sure how useful it is to compile on the phone instead of doing a cross-compile on a “proper” dev box but I guess to just get up and running it works. That depends. I tend to develop on the phone so I am aware of the screen size limitation, but you can emulate that. I also develop on the phone because the apps I make need access to the Modem (calls/SMS/MMS/VVM) for me test. I have thought about putting an EG-25 into my laptop to develop on my laptop, but that's been a low priority since using the Pinephone is easy enough. > Makes me want a PinePhone because I have an idea or two and have no idea how to program a simple app for my iPhone. I’d probably just use C though because I gasp like programming in C/simple C++. You should! The community is very friendly and helpful. All of the programs I developed are in C, so you aren't alone.
- rav3ndust 4y agoCan second this! The mobile Linux community is a very friendly and open space. I've been loving my Braveheart and PostmarketOS CE Pinephones, and am looking forward to picking up a PinePhone Pro to test and build with as soon as they're back in stock on Pine64 Store.
- fartcannon 4y agoIsn't that amazing though? Turns out those computers in our hands are actually just regular computers and all those dinks at Apple/Google are trying to nefariously lock us in!
- kop316 4y agoI'm not disagreeing, I think it is awesome! I built several apps that are aimed for Mobile linux, and the only reason I build them specifically on the Pinephone is because I need to test it with the modem.
- fartcannon 4y agoAwesome! Anything you wanna share?
- kop316 4y agoIf you are using a Pinephone and are in the USA, chances are you are already using (some of) them: I wrote mmsd-tng, the backend to giving MMS on the Pinephone: https://gitlab.com/kop316/mmsd/ https://gitlab.com/kop316/mmsd/ vvmd/vvmplayer, which enables Visual Voicemail: https://gitlab.com/kop316/vvmd https://gitlab.com/kop316/vvmd https://gitlab.com/kop316/vvmplayer https://gitlab.com/kop316/vvmplayer And phosh-antispam, which hooks into calls to hang up on Spammers: https://gitlab.com/kop316/phosh-antispam https://gitlab.com/kop316/phosh-antispam
- fartcannon 4y agoWow, as a pinephone user, let me just say thanks!
- kop316 4y agoYou're welcome! I hope they are useful.
- pjmlp 4y ago
- m463 4y agoIn the bigger scheme of things there's no setting up an apple dev or play store account. No fees. no asking permission. :)
- Stampo00 4y agoObligatory disclaimer that I'm not trolling or trying to start a flame war. I have dismissed Zig in the past in favor of Rust. But I've since found Rust difficult to keep up with since it's developing so rapidly and I don't use it daily. Zig seems like it has similar goals to Rust, but with a gentler learning curve. I know the Zig community isn't as big as Rust's, but maybe I wrote off Zig too soon. Anyone know of any objective comparisons out there? Is Zig gaining traction in a similar space to Rust?
- kitd 4y agoThere does seem to have been a lot of Zig coverage recently on HN, and that's by no means a complaint. But I'm not sure that it quite goes for the same space as Rust. I have only really kick the tyres, but it seems to me that Zig is to C what Rust is to C++, ie they both try to be the next-gen with better safety and features, but Rust's type modeling is more extensive than, and can contain complexity better than Zig, in the same way that C++ OOP is better than raw C. Zig has a good future though, and the metaprogramming facilities are superior to most languages IMO.
- Comevius 4y agoSome people think Rust is the best programming language for everything from embedded to web browsers, it's sweet spot however really is replacing C++. Zig's sweet spot is C, and it really helps that it was made to extend C, not completely replace it.
- nyberg 4y agoThat's just Zig flavoured EEE.
- Comevius 4y agoI don't really think that Andrew Kelley and his tiny non-profit have those kind of ambitions, or really if it would matter if they would. C is the lingua franca, there is no extinguishing it. These guys genuinely just want to make a practical, simple, common sense system programming language that let's you talk to the hardware, the operating system, and shovel bits around conveniently.
- A4ET8a8uTh0 4y agoI feel I should ask and I apologize in advance since its technically not on subject. I have an older PinePhone community edition. At the time I received, it was not ready for prime time ( not very usable as a daily driver ). That was ~2 years now? Have things improved?
- kop316 4y agoHere is one person's experience with it over the past two years: https://news.ycombinator.com/item?id=31806639 https://news.ycombinator.com/item?id=31806639 I have been using a Librem5 for the past six months full time, here is my comment on usage from ~week ago: https://news.ycombinator.com/item?id=31727098 https://news.ycombinator.com/item?id=31727098
- 3np 4y agoThings have improved a lot. It's night and day compared to 2 years ago. I have not tried Mobian, but otherwise I found postmarketOS has been the most robust, reliable, and unsurprising compared to Manjaro and Arch. I say it's at the point where it's worth a reassessment - if you're the kind of person who gets nostalgic about the first years of Gentoo, as desktop. It can be worth it to try Plasma, Phosh and SXMO (Wayland unless you already have an opinion). While it lasts multiple days in idle now, I'd get at least one spare battery for longer outings.
- Arnavion 4y agohttps://news.ycombinator.com/item?id=31238398 https://news.ycombinator.com/item?id=31238398
- blackbear_ 4y agoI daily drive it, Phosh works really well if you excuse the occasional crashes and freezes and slowness. Unlike the sibling I prefer Manjaro (and Arch) to postmarketOS because I feel that the former is faster to connect to wifi and mobile data when unlocking the phone, which is a significant quality-of-life improvement for me.
- desertraven 4y ago
- nim_user2 4y agoWhy not Nim?
- aliswe 4y agoI am just thinking can't we use web technologies for this instead?
- opencl 4y agoYou can use any technology you want that runs on ARM Linux for the Pinephone. But the hardware is very slow compared to pretty much any other modern phone, you will struggle to get decent performance from web technology.
- jhgb 4y agoSciter? Of course you can run UIs for Zig programs in Sciter, just like you can do it for C or C++ programs...
- jeroenhd 4y agoYou can, the PinePhone is just a Linux device after all. However, on a slow phone like the PinePhone you'll really notice the bloat and overhead the web stack adds to your programs and native tooling is a breath of fresh air. I don't understand why you'd want to drag the web into a phone GUI.
- UncleEntity 4y ago> I am just thinking can't we use web technologies for this instead? Please don’t… Assuming you want to have people download a massive electron app to look at cat videos.
- jeroenhd 4y agoI wonder how Zig stacks up against Vala as a GTK programming language. Both seem to try to be "better C", but the approaches are completely different.
- SLWW 4y agoGood to see that Zig is getting some love on such a neat phone. wonder how it would do on like Android.
- kramerger 4y agoNot really a zig person, that part of the article went above my head. But I am impressed with the idea of running vscode remote against the phone and compiling directly on the device.