Month: November 2019
MMS • Sergio De Simone
Article originally posted on InfoQ. Visit InfoQ
Since Swift was launched in 2014, Objective-C has known only minor changes, mostly aimed to improve its interoperability with Swift. Far from being a fringe language, though, Objective-C has recently added support for “direct” methods, which look like ordinary class methods but behave more like a C function.
While Swift has attracted the most interest as the language of choice to build iOS apps, Objective-C is still popular among developers. Indeed, if it is true that Swift overtook Objective-C in TIOBE index in 2016 for the first time, it is also true that Objective-C has climbed to the 12th position in TIOBE index as of November 2019, with Swift ranking 10th. Interestingly, too, the two languages have swapped their TIOBE rankings a number of times. Similarly, Stack Overflow language ranking, which measures language adoption based on the number of questions that were asked on the popular Q&A forum, highlights declining interest in Objective-C. Stack Overflow figure can be specifically explained with Swift gathering most of new developers entering the iOS development arena, as well as with the reduced number of changes made to Objective-C in the last few years.
For all of this, Objective-C new feature came somewhat as a surprise for many. In a nutshell, a direct method enables the definition of a special kind of properties that will carry no Objective-C metadata attached to them and whose getter and setter methods will behave almost as straight C function. The syntax for this new feature is an immediate extension of Objective-C @property
syntax:
@property (strong) NSArray* array;
@property (direct) NSString* directString;
The use of direct
methods removes some overhead related to Objective-C runtime method resolution through objc_msgSend
. This makes the use of this new feature interesting to optimize some critical path, as Peter Steinberger, iOS developer of PSPDFKit fame, remarked on Twitter. Not all overhead is removed, anyway, since direct
method implementation in LLVM strives to make it compatible with standard Objective-C methods. In particular, both the implicit self
and _cmd
arguments are preserved and a few checks are made to ensure both are sane at the moment the method is called.
There are a few limitations to how developers can use direct
methods. First and foremost, direct
methods can only be used on internal, private APIs, and cannot be exposed by frameworks. Additionally, overloaded methods cannot be direct
, nor direct
methods can be overloaded; an implementation cannot redeclare a non-direct
method of an interface it conforms to as direct
; required protocol methods cannot be direct
; finally, you cannot send an unqualified id
a direct
method.
Besides the possibility to optimize critical paths, reactions to this new Objective-C feature were not entirely on the positive side. iOS developer Tanner B remarked that direct
methods impairs a number of fundamental Objective-C features, such as KVC, KVO, method swizzling and so on. Day One app developer BJ Homer expressed his concern direct
method could be used by Apple to make tweaks harder to accomplish:
The objc_direct_members annotation seems to effectively implement truly-private methods for ObjC. Statically dispatched, not overridable. I can see Apple using that a lot internally to avoid people calling private methods.
This concern got somewhat dismissed by well-known iOS developer and book author Nick Lockwood, based on the fact direct
methods can only be private::
That should go some way to alleviating the concerns that it will fundamentally change the nature of Objective-C by blocking swizzling and breaking features like KVO.
This was also confirmed by Apple senior software engineer Pierre Habouzit.
As a final note, while direct
methods have been already merged into LLVM, it is unlikely they will be available in Xcode before next year WWDC.
MMS • RSS
Article originally posted on Data Science Central. Visit Data Science Central
This article was written by Synced.
Baidu this Thursday announced the release of ApolloScape, billed as the world’s largest open-source dataset for autonomous driving technology.
ApolloScape was released under Baidu’s autonomous driving platform Apollo, which Baidu hopes will become “the Android of the auto industry.” Apollo gives developers access to a complete set of service solutions and open-source codes and can enable for example a software engineer to convert a Lincoln MKZ into a self-driving vehicle in about 48 hours. ApolloScape’s open sourced data now provides developers a base for building self-driving vehicles.
The data volume of ApolloScape is 10 times greater than any other open-source autonomous driving dataset, including Kitti and CityScapes. This data can be utilized for perception, simulation scenes, road networks etc., as well as enabling autonomous driving vehicles to be trained in more complex environments, weather and traffic conditions. ApolloScape also defines 26 different semantic items — eg. cars, bicycles, pedestrians, buildings, streetlights, etc. — with pixel-by-pixel semantic segmentation technique.
The ApolloScape dataset will save researchers and developers a huge amount of time on real-world sensor data collection.
According to a Rand Corporation report, accumulating sufficient real road testing data to conclude a 20 percent advantage for autonomous vehicles over human drivers would require a fleet of 100 vehicles driving nonstop for 500 years.
Beyond data, ApolloScape will also facilitate advanced research on cutting-edge simulation technology aiming to create a simulation platform that aligns with real-world experience.
To read the rest of the article, click here.
DSC Resources
- Free Book and Resources for DSC Members
- New Perspectives on Statistical Distributions and Deep Learning
- Deep Analytical Thinking and Data Science Wizardry
- Statistical Concepts Explained in Simple English
- Machine Learning Concepts Explained in One Picture
- Comprehensive Repository of Data Science and ML Resources
- Advanced Machine Learning with Basic Excel
- Difference between ML, Data Science, AI, Deep Learning, and Statistics
- Selected Business Analytics, Data Science and ML articles
- Hire a Data Scientist | Search DSC | Find a Job
- Post a Blog | Forum Questions
MMS • Tyler Treat Matt Campbell
Article originally posted on InfoQ. Visit InfoQ
Tyler Treat attempts to disambiguate the concepts of Observability and Monitoring. He discusses how the complexity of elastic systems produces more unknowns that require a discovery-based approach. InfoQ recently sat down with Treat to discuss the topics of observability and monitoring, and he shares some challenges and best practices when introducing observability concepts.
By Tyler Treat, Matt Campbell