Slashdot Mirror


User: jblues

jblues's activity in the archive.

Stories
0
Comments
331
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 331

  1. Re:Objective-C was ahead of its time on Swift Vs. Objective-C: Why the Future Favors Swift · · Score: 2

    E.g. Java supports reflection and introspection and: does not use message passing!

    Read my comment again. I said that Java supports method interception while still using vtable dispatch. The reason for this is that it has a virtual machine and class-loader, which provides another point of interception. Examples of this are:

    • * The hibernate library uses cglib, which is in turn uses asm, to provide managed objects. You write a plain-old Java object and hibernate instruments this at runtime.
    • * Spring uses cglib or the aspectJ weaver to provide AOP features, such as annotation-based declarative transaction management or security
    • (There is another in J2SE that provides interception called Java dynamic proxies, but this only works for interfaces.)

      The above techniques of method interception do not work in C++, which uses vtable dispatch, because there is no JVM and class-loader to provide an intercept point. Therefore when it comes to things like managed objects, the observer pattern, or other features that can benefit from runtime instrumentation, we can't have these, and the next best thing is compile-time instrumentation. Given that Apple replaced the runtime garbage collector, with compile-time ARC, we might see them continue to provide 'dynamic' features at compile-time.

      So dynamic method interception most certainly has everything to do with message passing - its how compiled-to-executable machine language languages achieve this

      When it comes to reflection, C++ strips out meta-data. There are libraries to work around this, but its not a language feature. And except for enumerating a classes properties, to enable tool support, Swift follows suit. So there is no list of a classes methods, and no dynamic invocation. Again, as I said, this part does not have to be this way, but C++ is like this, and Swift follow suit. So message passing is loosely related to reflection and dynamic invocation here, in that by default vtable dispatch strips out method meta-data.

  2. Re:Objective-C was ahead of its time on Swift Vs. Objective-C: Why the Future Favors Swift · · Score: 1

    It uses messaging for communication between Objective-C

    doh - I meant to write 'for communication between objects', ie method invocation.

  3. Re:Objective-C was ahead of its time on Swift Vs. Objective-C: Why the Future Favors Swift · · Score: 2

    yea, yea yea; Python has all of that and is scripting language too boot. Google screwed up. Instead of java, morphed into android, they should have use python with a gtk stack.

    Python is great, but Java, by virtue of having a virtual machine can supports method reflection, method interception and dynamically generating new methods or instrumenting classes too, even though it uses vtable dispatch. Its still considered a 'late binding' language because the class-loader provides a hook-point, prior to emitting a just-in-time compiled class, the class loader can check for method interceptions and emit and instrumented one. . The catch is that Android's Dalvik platform introduces some quirks into this.

  4. Re:Replace C? on Swift Vs. Objective-C: Why the Future Favors Swift · · Score: 1

    "Swift will not only supplant Objective-C when it comes to developing apps for the Mac, iPhone, iPad, Apple Watch, and devices to come, but it will also replace C for embedded programming on Apple platforms."

    Not if you want to write something that compiles on other platforms. With Android/iOS being based on Linux/BSD it could very well make sense to write the back end of your app in C/C++ and only then branch into a different language as required by the GUI framework and other required proprietary APIs you'll be using.

    We tried this. It turned out to be not much fun. (Thought maybe we weren't doing it right).

    • * When the kernel is C++, unless you write a native language interface, it exposes the developers to C++. Its difficult to find developers who are good at C++, Objective-C and Java. Even experienced developers can make mistakes with regards to memory management.
    • Threading is usually a big concern. In Objective-C/C/Swift tools like grand-central dispatch make this easy, however in C++ its p-threads. C++11 has threads, but this isn't supported by Android yet.
    • The native environment give you an API of libraries and a community of open-source projects to fill in the gaps. With C++ you have identify and source your own stack. Poco or boost. etc.

    Perhaps with something like Xamarin's Mono framework the above points are less of a concern. An interesting one is Apportable.com (part funded by Google, I believe) are offering 75% of the App written in Objective-C or Swift and then a native UI in ObjC/Swift or Java.

  5. Re:Objective-C was ahead of its time on Swift Vs. Objective-C: Why the Future Favors Swift · · Score: 1

    Ahead of its time and just a decade or so behind Smalltalk in this regard.

    It still amazes me how languages are still trying to catch up with what I was doing in Smalltalk 20 years ago and others had been doing in Smalltalk since the 70s.

    And, yes a lot of what Smalltalk did was predated by other languages.

    Agree. Objective-C was most certainly based on SmallTalk. Though except for the message parsing, which can be considered a kind of interpreter, its compiled, and interoperable with C, which was its value proposition. It does seem that we're mostly just rehashing now, doesn't it.

  6. Re:Objective-C was ahead of its time on Swift Vs. Objective-C: Why the Future Favors Swift · · Score: 2

    * Object introspection - describe the methods and properties of an object * Dynamic invocation - reflectively invoke methods of an object. * Method interception - add or reroute methods for all instances or a single instance of an objection, optionally calling the original.

    All that has nothing to do with "message passing".

    You think so?

    Runtime method interception is supported in languages that use vtable style dispatch rather than messaging, only because these languages feature a virtual machine, and class-loader. Otherwise the function-pointers are compiled right in. It is not possible to perform method interception without evil. With Objective-C we can perform method swizzling - modify the lookup table to resolve methods to a function pointer) or isa swizzling - change the 'class', to a dynamically generated one, for a given instance at runtime. Cocoao's property observers use this. Its not possible without messaging. This is why AOP frameworks for C++ are compile time only.

    Object introspection & dynamic invocation : When methods are in-lined, statically dispatched or vtabled we can't reliably dynamically invoke a method. Even with the most flexible of these three, vtabling, we're still stripping the function name out so that its replaced with something like 'method[3]'. It doesn't have to be like this, but it is for C++ and Swift follows suit.

  7. Objective-C was ahead of its time on Swift Vs. Objective-C: Why the Future Favors Swift · · Score: 3, Funny

    Objective-C was ahead of its time. It uses messaging for communication between Objective-C, and using "the runtime" (a tiny virtual machine that is embedded into each executable) messages are resolved to a function pointer. Other compiled languages use static dispatch, vtable dispatch (allows overriding) or in-lining. However, messaging gives an advantage in that it affords features that are available in higher-level 'interpreted' or 'managed' languages:

    • * Object introspection - describe the methods and properties of an object
    • * Dynamic invocation - reflectively invoke methods of an object.
    • * Method interception - add or reroute methods for all instances or a single instance of an objection, optionally calling the original.

    The above features allow all kinds of useful things like Aspect Oriented Programming, instrumented objects at runtime (eg for object-relational-mapping), Cocoa's elegant property observers, etc. Another advantage is that Objective-C is close to the bare-metal so its very easy to take advantage of the above, while dropping back to raw C (or C++) as needed for performance tuning, which given the 95-5 rule is not too often.

    Contrast these dynamic features, with C++ which fills another niche. Now the industry has had 30 years to forget how useful these features are, so Swift uses static and vtable dispatch. Given a virtual machine, with just-in-time compilation this is no problem, but as a compiled language it means forfeiting the above. Swift allows the above if a class extends a Cocoa Foundation class, but this problems are:

    • * Developers are excited about writing 'pure' Swift.
    • * The advantage or dynamic dispatch is that it can be applied to any class. Now if Swift adds compile-time AOP, this will only work with code that you have the source for.
      • I'm surprised more people didn't raise concerns about this.

  8. Re:Uber-Jeepney? on Philippines Gives Uber Its First Legal Framework To Operate In Asia · · Score: 2

    Seems like a natural fit for the Philippines, given the blessed anarchy of the Jeepney:

    http://en.wikipedia.org/wiki/J...

    Disclaimer: I spent a couple of years in the Philippines as a child, but haven't been back in decades. So Jeepneys may not be as widespread/chaotic as I remember.

    Oh there's still literally millions of them, most with very poorly tuned engines belching out smoke and driving chaotically with no indicators. While I love the idea of an elastic, demand based, self adjusting dispatch system for mass transit, I'm not sure how Über would help in the Jeepney probelm. There's usually such a demand for jeeps, that it takes less than a minute or two to catch a ride. They drive well-defined routes with a regulated fee, and transfer from residential areas onto these thoroughfares is done by tricycles. I think it would be better to concentrate on:

    • * Get the tricycles to use well-tuned, and definitely not two-stroke engines, and drive safely. Progress is being made here.
    • * Using well maintained, less polluting Jeeps. There are standards for this but they are not enforced. Its easy to bribe your way through a smoke belching test.
    • * Having Jeeps stop only at dedicated bus-stops, instead of suddenly and randomly halting anywhere. So as not to hold up other traffic, including other jeepneys
    • * Where appropriate using larger buses, instead of mini-bus sized vehicles.
    • * Improve comfort to encourage people who use private vehicles to instead take public transport.

    As freeways are being built, some of the long jeepney routes are being replaced with air-conditioned buses. And the rail network is improving. While there's a huge demand for public transport, there's also massive private vehicle congestion. Meanwhile, in Tokyo, which is about the same size as Metro Manila (somewhat larger actually), you can walk less then 200 meters to catch a high-speed train. Amazing.

  9. Re:only i3/i5 on Russian Company Unveils Homegrown PC Chips · · Score: 1

    I would, I'd like my spying more diversified rather than having everything i do tracked by a single agency.

    There's a Russian Facebook, its called VK.com. I would speculate that the spying is on-par with Facebook.

    As for end-user features, one of their differentiators is that there's also a music sharing feature where you can share your music with, basically every other VK.com user - not very popular with record labels, I'm sure.

  10. Re:You're screwed on Ask Slashdot: Moving To an Offshore-Proof Career? · · Score: 1

    All the jobs suitable for introverts, autistic spectrums, and people with just plain bad social skills are gonna go. The jobs left will be those actually calling the shots and bringing home the bacon. If you're reading this website that's probably not you, in other words. Thanks for playing!

    Funny, sad and true all at the same time.

  11. Re:Ownership and Appreciation on From Commune To Sharing Economy Startup · · Score: 3, Insightful

    As nice as communism sounds

    Never sounded nice to me, and of course it fails every where it is implemented.

    I actually like communal roads, schools, police, hospitals, military and so forth. The place that I live now is more towards a completely unregulated market and its not as great as you'd think. Sure, we live well with two maids and a driver, but step outside our gated village and its total mayhem.

  12. Smokey Mountain on The World's Most Wasteful Megacity · · Score: 4, Interesting

    In Manila, there was a trash heap, Smokey Mountain, that was so large that it would regularly catch fire under its own decomposing weight. People made their livelihood there, so that, sadly, one could claim to be 3rd generation Smokey Mountain. It has been shutdown (and grassed over) now, but the new dump-site, Payatas is home to some 80,000 people.

  13. How about paying taxes and not lobbying the country to shreds? Maybe then we could all have schools.

    Prosperity *is* pizza you fucks.

    I went to a state-run school for the criminally gifted. I can't help but think if it was a private school I might've ended up somewhere like Goldman Sachs.

  14. Re:Batteries with Solar Systems = No Net-metering on Tesla's Household Battery: Costs, Prices, and Tradeoffs · · Score: 1

    From my experience in the PH, just having the battery to keep your power on when the local power fails on a regular basis would be worth something even without solar cells.

    Yeah. But cost and energy density are still problematic. For $100 bucks I can buy a 3000W generator that will run a wall-unit aircon and a bunch of devices for hours. And spare fuel to last days would hardly take any space at all. Maybe not super quality but things can be repaired very cheaply here. Similar batteries, as far as I know will cost quite a lot more. I would rather be using a renewable source though.

    The biggest problem on those stormy nights is staying cool. We've got gas cooking, and a laptop with battery and 3G internet that can beep me working. I can happily live without other appliances for a while. So. . . . you can buy these these electric fans with a built-in light and battery - pretty useful. This storm-season I'm gonna take it one step further and keep a "battery of coldness" in the freezer (big chunk of ice). And then with with some copper tubing, two buckets, gravity and some ice, I'll rig up a make-shift battery powered air-con. I saw the design for that on Slashdot a few years ago.

    The last Typhoon to come over the town messed up the place pretty well. Just around the corner there was a power pole blown down. Yes by the next evening power was back up. Given the chaotic state of the infrastructure to being with, this was pretty impressive.

  15. Re:I've had the watch 10 days on Apple Watch's Hidden Diagnostic Port To Allow Battery Straps, Innovative Add-Ons · · Score: 1

    And there hasn't been a day where I thought I'd run out of battery power. I've been wearing it at night, and most mornings I wake up with it still about 30% full. This is the 42mm model.

    With a little prescience we can go one step further than that. I simply strapped an iPhone 3GS onto my wrist. If we look evolution of the original iPhone through to the current iPhone 6+, it doesn't take a genius to see that a 3GS will be very similar in specifications to the iWatch, er, Apple Watch 6+

  16. Re:Batteries with Solar Systems = No Net-metering on Tesla's Household Battery: Costs, Prices, and Tradeoffs · · Score: 1

    Yes, but are you allowed to sell back at the rate you purchase electricity? Because if its 10-30x reduction, battery is worth more.

    I'm not actually sure, but I doubt it would be the same rate as purchased. Off-grid with storage sounds like its becoming more and more attractive. . Myself, I haven't bought the PV cells yet, but its something I want to do in the next year or two. I'm also looking for better solutions to staying cool - that's where most of our electricity goes.

  17. Re:Batteries with Solar Systems = No Net-metering on Tesla's Household Battery: Costs, Prices, and Tradeoffs · · Score: 4, Interesting

    Companies like SolarCity basically install solar systems for no money up front, and then lease them back to you for a period. For many houses, even with these fees, the SolarCity systems will save the homeowner quite a bit of money. Licenses to sell power back to the grid are usually restricted, even in states they are allowed. If you have a battery system installed, you will no longer have to sell your excess solar energy back to the grid. You'll simply be able to store it in your battery for later use. Thus, homeowners with these systems may not have to apply for licenses for their solar systems, since they will not be doing net-metering. This will allow many users to install solar panels who couldn't before. It removes the ability for utilities and/or state governments to restrict the number of homes with solar panels. This is why these batteries will likely have a huge impact.

    Here in the Philippines, its allowed for any homeowner or business to sell electricity back through the grid. It took me a lot of research to find this out - its not widely publicized at all, and I haven't seen many folks taking the option. It could be a great option given pretty good (2200 hours) of sun per year and very high priced electricity, which as it happens is often used for cooling during the day. I guess that given a per capita GDP of something like $7000/year most people can't afford this yet. . . On the other hand much of the commercially produced electricity is from renewable sources, particularly hydro and thermal, but some of the small villages have their own solar plant - provides only enough for basic needs.

    As it happens we have not a smart meter in front of the house, but one of the old magnetic kinds that will (AFAIK) happily run in reverse.

  18. Re:I work in Detroit on Want 30 Job Offers a Month? It's Not As Great As You Think · · Score: 2

    uh.... it's *detroit* /nuffsaid

    Oooh, sounds divine! According to the internet the city that I live in has a quality of life Index of 30.57, while Detroit scores 184.59. (Larger number is better) :)

    Oh! But get this. . . My 3rd world city has a health-care score index of 'High', while 'Detroit' scores 'Moderate'. Translation: city in the USA has worse than 3rd-world standard of healthcare. I'm guessing its not the only one.

  19. Re:I work in Detroit on Want 30 Job Offers a Month? It's Not As Great As You Think · · Score: 1

    uh.... it's *detroit* /nuffsaid

    Oooh, sounds divine! According to the internet the city that I live in has a quality of life Index of 30.57, while Detroit scores 184.59. (Larger number is better) :)

  20. Re:Selling Freezers to Eskimos on Obama Announces e-Book Scheme For Low-Income Communities · · Score: 1

    I don't go to the USA often, but last time I was there, there was free Wifi all over the place, especially in inner-cities areas where today's urban poor live.

    And, as I said in the comment above, most people in my own country are much poorer, but even the 30% living well below the poverty line in makeshift housing have access to pre-paid 3g internet using cheap Android SmartPhones.

  21. Re:Selling Freezers to Eskimos on Obama Announces e-Book Scheme For Low-Income Communities · · Score: 1

    So exactly what use are low-priced e-books to people who don't own computers?

    You can get a decent computer for $20 from Goodwill. You can buy a used Kindle on eBay for about the same. Computers are common, even in poor households. They aren't luxuries anymore.

    Yup. I've visited a few slums in developing nations, with people living hand-to-mouth in basic conditions. But there's very often at least one large-screen cell-phone or tablet computer per household. I would certainly hope the situation is even better in the USA.

  22. Australia has this on Obama Announces e-Book Scheme For Low-Income Communities · · Score: 3, Insightful

    My mom regularly borrows ebooks from the library in regional Australia. The system used is called Bolinda Borrow Box. Sounds like it works pretty well. Only epub is supported though, no no kindles.

    Meanwhile, here in Manila Hernando Guanlao, 60-something, converted his whole house into a library (http://www.bbc.com/news/magazine-19547365), to honor his mother and father after they died. He said: "As a book care-taker, you become a full man.

  23. Re:How about... on Tattoos Found To Interfere With Apple Watch Sensors · · Score: 1

    How about "Emergency services personnel can't use a pulse oximetry device on your tattooed skin in order to save your life following a car accident"?

    Don't most pulse oximeters work by shining a certain frequency of light through fingernails? You'd have to be tatooed under every fingernail - full hiptard level.

    Even in the absence of a suitable finger an earlobe, toe or penis should work nicely. (Well . . . not sure how effective the latter would be. Might have to disregard readings taken during sponge-bath time, when oxygen saturation goes up to about 350%)

    Also the thing about pulse oximetry: perfect accuracy is not required. Their benefit is that they are light, cheap and portable (in aluminum and space gray configurations, not gold) so can be used as an indicator that intensive care is required. They measure oxygen saturation, but are not effective at indicating respiratory acidosis, for example. Once in an intensive care setting, there's other ways to measure organ perfusion.

    DISCLAIMER: The above might be complete horse@#(&, as I'm not a doctor - just read medical encyclopedias from time to time ;)

  24. Re:Talk about creating a demand on Why Our Antiquated Power Grid Needs Battery Storage · · Score: 3, Interesting

    A couple of off-the-cuff examples: lifting a very large weight with your excess electricity, then running a generator with it during peak loads or periods. (Did I say VERY large weight?)

    The very large weight would have to be sourced quite locally otherwise the shipping / transport costs to install it onsite would be prohibitive. Maybe design the whole house so it could be hoisted up during the daytime and then sink back down at night ;) That would be cool.

  25. Re:Damn... on Woman Behind Pakistan's First Hackathon, Sabeen Mahmud, Shot Dead · · Score: 2

    I forgot to mention: Despite the fact that the MILF are now considered a legitimate political organization, and not a terrorist group, they recently acquired a fucking submarine to go with the rest of their military assets. Go figure? (Or was it another group that did this? There are several here now. I can't find the citation, because Googling 'MILF Submarine' yields some unfortunately irrelevant, yet nonetheless interesting results.