Re: OFFTOPIC Re: I've just released Vasaro
On Thursday, 13 December 2018 at 21:55:00 UTC, Jacob Carlborg wrote: You don't need that hack with an extra interface called "Class" anymore. It's now possible to declare static/class methods directly, which wasn't possible before. Oh, nice. Yeah, that's what it was. I renamed it and got it to compile and run again, but it really is a bunch of ugliness so being able to remove it is nice. I am still having some trouble with the child classes, but you said that still sucks. My mixins basically do it, but yeah I am looking forward to this just working. I'm not sure if DIP43 needs to be changed. It's what I'm following when implementing, more or less. It's just that not everything in DIP43 has been implemented yet. I see. Well, thanks for your work on this. It is coming together nicely.
Re: OFFTOPIC Re: I've just released Vasaro
On 2018-12-13 00:36, Adam D. Ruppe wrote: So I got out my code that (with your help about a year ago) was doing a hello world window and menu, but now it doesn't compile, complaining about a hidden Class clashing with my Class. Hmm, it was not my intention for that to be exposed yet. You don't need that hack with an extra interface called "Class" anymore. It's now possible to declare static/class methods directly, which wasn't possible before. Technically in Objective-C static methods are instance methods on the metaclass. All classes in Objective-C are objects, they're instance of the metaclass. Each class has a corresponding metaclass. The class/interface you have implemented called "Class" was the metaclass, manually declared. This metaclass is normally not visible in the source code in Objective-C. What we did was we declared instance methods on the metaclass, this is now handled behind the scenes when you're declaring a method with "static" in the normal class/interface. If you're code is looking like this: extern (Objective-C) interface Foo { extern (Objective-C) interface Class { Foo alloc() @selector("alloc"); } } You can now replace it with this code: extern (Objective-C) interface Foo { static Foo alloc() @selector("alloc"); } And you can directly call "Foo.alloc()". It was not my intention to break existing code. I think if you rename your "Class" to something else it will continue to work. What is the current state and roadmap for this support? There's no roadmap. It's whenever I got time to work on the Objective-C integration. Lately I've been prioritizing other work. But it would be the next thing on the list of Objective-C features to implement. The stuff described here seems wrong: https://dlang.org/spec/objc_interface.html No, that's correct. The example at the bottom compiles and runs correctly using DMD 2.083.0. and this apparently hasn't been edited for years: https://wiki.dlang.org/DIP43 but SEEMS to be what closest matches up. I'm not sure if DIP43 needs to be changed. It's what I'm following when implementing, more or less. It's just that not everything in DIP43 has been implemented yet. -- /Jacob Carlborg
Re: OFFTOPIC Re: I've just released Vasaro
On 2018-12-12 15:52, Adam D. Ruppe wrote: On Tuesday, 11 December 2018 at 10:19:38 UTC, Jacob Carlborg wrote: Which year is the machine from? It should say that after the model. Oh, I had to click "more info". MacBook Air 11-inch, Mid 2011 So I guess it is quite old. I have tried to do the OS update several times before and it consistently just freezes (usually the progress bar stops, the system keeps working, but one time it did outright restart itself), this probably explains why. Yes, it's too old for Mojave. But it looks like you can run High Sierra [1]. It's just one version old. [1] https://support.apple.com/kb/SP765?locale=en_US -- /Jacob Carlborg
Re: OFFTOPIC Re: I've just released Vasaro
On Tuesday, 11 December 2018 at 10:19:38 UTC, Jacob Carlborg wrote: I would recommend waiting until more of the Objective-C support is implemented. Creating a subclass is a pain in the ass currently. So I got out my code that (with your help about a year ago) was doing a hello world window and menu, but now it doesn't compile, complaining about a hidden Class clashing with my Class. What is the current state and roadmap for this support? The stuff described here seems wrong: https://dlang.org/spec/objc_interface.html and this apparently hasn't been edited for years: https://wiki.dlang.org/DIP43 but SEEMS to be what closest matches up.
Re: OFFTOPIC Re: I've just released Vasaro
On Tuesday, 11 December 2018 at 10:19:38 UTC, Jacob Carlborg wrote: Which year is the machine from? It should say that after the model. Oh, I had to click "more info". MacBook Air 11-inch, Mid 2011 So I guess it is quite old. I have tried to do the OS update several times before and it consistently just freezes (usually the progress bar stops, the system keeps working, but one time it did outright restart itself), this probably explains why. I would recommend waiting until more of the Objective-C support is implemented. Creating a subclass is a pain in the ass currently. Yeah, I know. I have made some mixins to help smooth it over a little though. That is one of the reasons why I am waiting a bit, but I feel if I wait on dmd I'll be waiting forever. I'd like at least the basics to work.
Re: OFFTOPIC Re: I've just released Vasaro
On 2018-12-10 14:55, Adam D. Ruppe wrote: Ah, there it is: 10.9.5, 1.6 GhZ Core i5, 2 GB. (c) 2016. Actually not that old. Which year is the machine from? It should say that after the model. For me it says: "MacBook (Retina, 12-inch, Early 2015)". If it's from mid 2012 or newer you can upgrade to the latest version of macOS, if you want to [1]. Well, I still want to add the support to my library anyway. At least the minimal stuff - create window, create opengl context, dispatch events, so it can serve as a base for other users to PR the other functions if they use it. I am also very slowly working on some objc helper functions (though I wish the headers were at least in druntime like win32 is now) That's why I got this and it is still on my list, it is just somewhat far down on my list. I would recommend waiting until more of the Objective-C support is implemented. Creating a subclass is a pain in the ass currently. [1] https://support.apple.com/kb/SP777?locale=en_US -- /Jacob Carlborg
Re: OFFTOPIC Re: I've just released Vasaro
On Monday, 10 December 2018 at 10:47:42 UTC, Jacob Carlborg wrote: If you click on the Apple menu in the top left corner and choose "About This Mac", it will say which model and which year in the window that appears. It will also specify which version of the OS it's running. Ah, there it is: 10.9.5, 1.6 GhZ Core i5, 2 GB. (c) 2016. Actually not that old. If you don't want to keep it you could always donate it as a testing machine, if the Dlang foundation will accept it. Well, I still want to add the support to my library anyway. At least the minimal stuff - create window, create opengl context, dispatch events, so it can serve as a base for other users to PR the other functions if they use it. I am also very slowly working on some objc helper functions (though I wish the headers were at least in druntime like win32 is now) That's why I got this and it is still on my list, it is just somewhat far down on my list.
Re: OFFTOPIC Re: I've just released Vasaro
On 2018-12-08 18:01, Adam D. Ruppe wrote: The one I have is a macbook air with a broken, but usable screen (I got it for free yay). I don't know how old it is, I *think* it is a 2013 model. If you click on the Apple menu in the top left corner and choose "About This Mac", it will say which model and which year in the window that appears. It will also specify which version of the OS it's running. I know it won't take the new OS update from Apple, but it was able to run dmd on it last time I tried (which was like 9 months ago lol). DMD will run on Mavericks (10.9) or later. If you don't want to keep it you could always donate it as a testing machine, if the Dlang foundation will accept it. -- /Jacob Carlborg
Re: OFFTOPIC Re: I've just released Vasaro
On Saturday, 8 December 2018 at 08:30:08 UTC, Russel Winder wrote: If you don't want the macOS laptop and it is a post-2014 one, I'd be interested. The one I have is a macbook air with a broken, but usable screen (I got it for free yay). I don't know how old it is, I *think* it is a 2013 model. I know it won't take the new OS update from Apple, but it was able to run dmd on it last time I tried (which was like 9 months ago lol). As long as dmd runs, it is potentially useful to me, just while I know XLib and Win32 already, I know basically nothing about obj-c and cocoa, and I'm not terribly motivated since I can't stand Mac OS as an end user either, so I don't see myself ever actually using this stuff. Still, it is a feature request from time to time, and I imagine basic 2d drawing and input events aren't likely to change *that* much, so if I can get it working on this old computer I figure the library will probably also work on newer ones - or at least it will be easy for a OSX developer to send me a bugfix PR.