Tuesday, November 28, 2017

Mobile Smalltalk

I've been announcing the Open Beta release of my game HexSolve for Android and iOS.  HexSolve was written in Smalltalk and people have been asking me how it's possible to run Smalltalk on mobile devices.  I thought I'd write up a little description of the technology behind it.



I've wanted to be able to run Smalltalk on Android and iOS for many years.  I finally decided to do something about it.  I chose VisualWorks for my development environment.  Unfortunately iOS doesn't support dynamic compilation so getting the regular VisualWorks VM to run on iOS is virtually impossible.  I decided to skirt around the issue by writing my own VM.

My VM is written in C.  It interprets the same bytecodes as those generated by VisualWorks so I can use the VisualWorks compiler to compile all of the code for the mobile Smalltalk.  Being a pure interpreter, I get around the problem of dynamic compilation on iOS.  Apple is okay with an interpreter so long as all of the code it's interpreting is delivered with the product and not downloaded dynamically.

Development of the Smalltalk code begins in VisualWorks.  I have my own Object class (in my own namespace) as well as my own copies of the other base classes (True, False, UndefinedObject, etc.).  I did this because I had better control of the implementation than I would if I just used the VisualWorks base code.  If I used the regular VisualWorks classes, then I would need to bring in more and more of the base code to get those classes to work.  There are just too many "strings attached" to do this effectively.



Methods beginning with an underscore ($_) will have the underscore removed when moving the image to the mobile device.  It allows me to have one version for Mobile Smalltalk and a different version for VisualWorks.  You can imagine that it would be bad if I re-defined at:put: in VisualWorks.

I have an ImageBuilder utility that takes all of the code in the packages "SimTalk Remote Core" (base Smalltalk code) and "SimTalk HexSolve" (the game itself), packages them into a special 64-bit image format and writes the image into a file.  I can then use AndroidStudio or XCode to include this image as an asset to deliver to the device along with the interpreter.

The interpreter itself is a 64 bit image.  It uses immediate objects (tagged objects that fit within the object pointer) for SmallInteger, Character and Float.  This allows me to do faster operations on these objects without allocating memory.

The game uses Smalltalk primitives to interface to OpenGL ES which runs on both Android and iOS. For text, I interface to Freetype which is compiled and delivered with the game.  Freetype will create images for the characters which I can collect and cache in a Smalltalk Image object.  I then render these images as OpenGL textures.

My mobile Smalltalk is single-threaded - there's no such thing as fork, a Process or a ProcessManager.  In fact, Smalltalk runs completely as an OS callback.  When the OS determines that something happened (a touch event, a button or a timeout), it runs a callback in my VM.  The VM creates an Event object, drops it into a known spot in the image and runs the interpreter.  The interpreter then reads the event, dispatches it, re-renders the screen if necessary then calls suspend which returns from the OS callback.  Nothing more happens until the next OS callback.

Some people have asked me when I'll release this technology so they can use it.  I'm sorry to say, but I don't intend to do that.  This is for internal use for me to write Smalltalk code for Android and iOS.  I have several problems if I try to commercialize the development technology:

  1. You can't develop code in this environment without a VisualWorks license.  I have such a license with Cincom but it's hard to tell other developers that they need a license for VisualWorks plus a license for my mobile development environment and it's hard to enforce.
  2. I've implemented interfaces to API's I need in the OS but not to everything.  Other developers would need probably access to accelerometers, GPS, Internet, cameras and other things.  I can't have a good commercial product without those interfaces and it's too much work to write these interfaces on speculation.
  3. Too many companies have died trying to provide tools for developers to enhance Smalltalk environments.  The market isn't big enough to justify the effort.
  4. To be honest, software developers make lousy customers.  They tend to be very demanding on everything they need and usually don't like paying money for what they get.  They're used to software development environments being free and open source and don't want to pay for development and maintenance of their toolset.
  5. I'd rather create fun profitable games than creating development environments for other people to use to create fun profitable games.
The graphics for HexSolve were all rendered using POV-Ray.

I hope that answers most of your questions.  Happy Smalltalking.

120 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. You just earned your spot on the list of coolest smalltalkers! Frankly I never thought such an interpreter would be a manageable project but you just proved me wrong. Looking forward to lots of VW-based apps :)

    1-4 = you're preaching to the choir. Mobile support is a problem for Cincom to solve when they see enough potential revenue. Frankly I develop for iOS and watchOS almost exclusively these days and I'm pretty happy with Swift and XCode. The value proposition to bring Smalltalk to iOS is limited unless you're prepared for a substantial feature set (including debugging the app "on device" and providing access to iOS frameworks).

    Anyway, very cool stuff and best of luck to you!

    ReplyDelete
    Replies
    1. Thanks, David. I've already had a few questions asking when I'll release this technology for others to use. I'm glad you agree that it's a difficult thing to do.

      Delete
  3. Very cool!

    Good point about devs not wanting to pay for software.

    If someone wants to use Smalltalk on iOS/Android without developing their own interpreter, check out Squeak. It's not trivial to make an app for mobile with it, but certainly easier than creating an interpreter from scratch. E.g. "Pyonkee" is an app in Apple's store that uses the Squeak VM.

    ReplyDelete
  4. We use S8 to build iOS and android native applications with Smalltalk
    Take a look at S8 Smalltalk platforms and U8 tools.
    We do not use a smalltalk VM, nor bytecodes (our intermediate code
    is javascript source code in iOS and android) more freedom on where
    to run; 100% MIT licensed and social development.

    For iOS native applications, 100% of application is written
    in S8 smalltalk, using and creating Objective-C classes
    dynamically on demmand; implementing the methods
    in Smalltalk (of new classes and additions/replacements
    of native classes).

    For Android we use something similar to use and interact
    with Java; and also implement prototype based interfaces
    when required (of course, again, 100% S8 smalltalk).

    In short we use smalltalk, without the old parts; e.g. VM
    and forced encapsulation of contents, that prevents the
    wide use of smalltalk systems in modern execution contexts.

    References: (links to start a tour on S8 and social software dev. with Smalltalk)
    http://u8.smalltalling.net - Main service portal for Social software development with Smalltalk
    http://aleReimondo.no-ip.org/U8 - main community swiki for S8 smalltalk and tools (U8)
    http://aleReimondo.no-ip.org/s8media - media swiki for collaborative development and testing
    https://www.facebook.com/groups/s8smalltalk/ - S8 Smalltalk Facebook group

    cheers,
    Ale
    p.d.: I tried to send this text as an email through squeak-dev list
    but the list refuses to post my email.

    ReplyDelete
  5. This comment has been removed by a blog administrator.

    ReplyDelete
  6. The article was up to the point and described the information very effectively. Thanks to blog author for wonderful and informative post.
    infinite logo design
    logo design uk
    professional app development

    ReplyDelete
  7. This is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.
    iphone training institute in bangalore
    best iphone training institute bangalore
    ios app development in hyderabad

    ReplyDelete
  8. Nice Blog, When i was read this blog i learnt new things & its truly have well stuff related to developing technology, Thank you for sharing this blog.
    iPhone app training course in bangalore
    Mobile app training institutes bangalore
    iPhone job oriented course in bangalore
    iPhone training classes in bangalore

    ReplyDelete
  9. Thank you for your post. This is excellent information. It is amazing and wonderful to visit your blog.
    mobile app training institutes
    iPhone App Training Course

    ReplyDelete
  10. Thank you very much for share this blog.I think it is helpful to all.
    we are providing job oriented training classes for mobile app development in institute for all the mobile apps like ios apps,android apps and more. which gives quality training by real time faculty.
    Would you like to visit my website :

    https://www.targettraining.eu/soft-skills-pathway/
    https://blog.internshala.com/2016/10/my-struggle-with-english-language-and-how-i-mastered-it/

    ReplyDelete
  11. This is an amazing post you have published with us . Keep continue sharing
    clipping path service

    ReplyDelete
  12. This is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.
    iphone app training course
    iphone training classes in bangalore
    iphone training

    ReplyDelete
  13. Nice Blog, When i was read this blog i learnt new things & its truly have well stuff related to developing technology, Thank you for sharing this blog.
    iPhone app training course in bangalore
    Mobile app training institutes bangalore
    iPhone job oriented course in bangalore
    iPhone training classes in bangalore

    ReplyDelete
  14. Gathered lot of ideas from your resourceful article. The article is worth reading for beyond any doubt. Thanks once again for sharing the resources.
    Clipping Path | Shadow Creation | Vector Conversion | Product Photo Editing

    ReplyDelete
  15. Beautiful location! It is also universal and standard quality. Hope for best grammatical business.
    remove background from image photoshop

    ReplyDelete
  16. Thank you for your post. This is excellent information..http://clippingpathindie.com/furniture.html

    ReplyDelete
  17. thank you for your post. keep sharing this type of post Clipping Path Services.

    ReplyDelete
  18. thank you for your post. keep sharing this type of post Buy
    clipping path inia

    ReplyDelete
  19. This is a most important blog and it’s very helpful for us. Thanks for sharing .
    Clipping Path Service

    ReplyDelete
  20. Nice Blog.
    https://www.graphic-aid.com/clipping-path
    https://www.graphic-aid.com/
    https://www.graphic-aid.com/neck-joint-service

    ReplyDelete
  21. Excellent post. We provide high-quality
    real estate photo editing
    at a cheap price.

    ReplyDelete
  22. Nice Blog, When i was read this blog i learnt new things & its truly have well stuff related to developing technology, Thank you for sharing this blog.
    creative website designing services
    Android and ios app development in kukatpally
    list of Digital marketing companies

    ReplyDelete
  23. hi dear,this is very good and helpful article thanks for shearing.

    ReplyDelete
  24. We provide all major photo editing service such as background removal, image masking service, clipping path service, vehicle photo editing service, image shadow service, ecommerce photo editing service etc.

    ReplyDelete
  25. Toko Otomotif : alat teknik, perkakas bengkel, alat safety, alat ukur, mesin perkakas, scanner mobil, alat servis motor, alat cuci mobil, mesin las.

    ReplyDelete
  26. I really appreciate this post and I like this very much. I am waiting for new post here and please keep it up in future.
    Mobile App Development Company Islamabad

    ReplyDelete
  27. I am very happy when reading this blog post because the blog post was written in good manner and write on a good topic. Thanks for sharing valuable information.
    Mobile App Development Company in Bangalore | Website Design Company Bangalore | Web Development Company Bangalore | Digital Marketing Services in Bangalore .

    ReplyDelete
  28. Proflowers Pakistan is the largest privately owned online flower store in Pakistan. We endeavor to make your experience ordering flowers with us memorable. Our online store offers a collection of exclusive gifts including a teddy bear, leather wallets; customize chocolate cakes and balloon delivery, for same day delivery flowers or next day delivery. We know that when you send flowers online it comes from the heart, so we work hard to ensure your sprays are fresh, lovely, and eye-catching and delivered in time to celebrate every occasion.

    Send Flowers to Pakistan
    Send Flowers to Lahore
    Send Flowers to Islamabad
    Send Flowers to Karachi
    Send Flowers to Rawalpindi
    Online Flowers Delivery to Pakistan
    Mothers Day Gift to Pakistan
    Birthday Flowers to Pakistan
    Online Birthday Flowers
    valentine Day Flowers to Pakistan
    Online Roses Delivery
    Send gift to pakistan

    ReplyDelete
  29. This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post.
    app development company in mumbai

    ReplyDelete
  30. Most of my visit in articles or blogs, I didn’t get too long in reading, but this one I don’t know how it caught my attention! So I want to share to you outsource seo packages singapore. Don’t hesitate to ask me!

    ReplyDelete

  31. Erectile dysfunction or impotence is a health issue that is suffered by men. In this problem, the man becomes unable to get the perfect erection. Irregular blood flow in the body is the cause of this problem. This problem may happen because of various reasons. By taking the help of smart drugs, this problem can be solved. Viagra 150 mg is very effective as an ED pill. Viagra is a brand version of Sildenafil which is a PDE5 inhibitor. It cannot cure your ED, but when you take it with proper sexual arousal, and then it can help you in getting the perfect erection. This ED pill you can easily find in the market. Buy Viagra online and thus you can get this ED pill at an affordable price. There are lots of benefits you can enjoy if you buy Viagra online.
    Buy Viagra online

    ReplyDelete
  32. Top mobile app development company do not target the audience around the globe. They first outreach a particular group of audience that may include a particular region or demographics, psychographics, habits 7 lifestyle. This way you will be able to grab the attention of the audience better for your mobile app.

    ReplyDelete
  33. Thanks for sharing this blog. The content is beneficial and useful. Very informative post. app development company in bhopal
    Top It companies in Bhopal
    Companies in MPNagar Bhopal

    ReplyDelete

  34. Azad Soch Punjabi epaper and Punjabi newspaper Publish from Punjab India. Latest Punjabi epaper - Find all Latest News in the Punjabi Language – Business news in Punjabi, Sports news in Punjabi, Viral News and top stories from all across India read only at azad soch Punjabi epaper. latest Punjab news, Punjab news, Punjab news online, Punjab news, Punjab news headlines, Punjab Latest News, Punjab News, Punjabi News Online, Punjabi epaper, epaper Punjab, punjabi epaper, Punjabi News paper, Punjabi e-paper, Azad Soch Punjabi Epaper, Punjabi Newspaper, latest Punjabi epaper


    punjabi epaper

    punjabi news

    punjabi news paper

    punjabi newspaper

    today news in punjabi

    latest punjabi news

    punjabi news today

    punjabi latest news

    https://epaper.azadsoch.in/

    ReplyDelete
  35. Thanks for sharing such a good information about the iOS Apps Development Company Islamabad,
    iOS Apps Development Company Islamabad

    ReplyDelete
  36. We provide database solution for telemarketing activities for the client to target their appropriate market.we have all the data city wise phone number list. State wise phone number list. List of Indian phone number with name. we are the best database provider in India and we provide phone number and email list.

    mobile number database

    indian mobile number list

    phone number database

    indian mobile numbers list

    indian mobile number directory

    indian phone number directory

    mobile number database provider

    all mobile number list

    phone number list

    mobile number list with name


    https://itbrood.com/products/all-india-phone-number-database.php

    ReplyDelete
  37. Thank you for your post. This is useful information.
    Here we provide our special one's.
    logo desiging in Guntur
    print media services in vijayawada
    seo experts in Vizag

    ReplyDelete
  38. Hey this one is a very nice article and its is going to help the audience a lot and will help them with the knowledge of IOS app development and will also enlighten them with the knowledge of the same. If you want one of the best Best IOS app development services then Softgains technologies is the place you should go for

    ReplyDelete
  39. Thanks for sharing nice post...

    Some of the best Mobile App Development Company In Phoenix Arizona find the way to help their clients to reach to the wide range of consumers using the smartphones and so many corporates attribute their success to the mobile app development. In today's time, users want everything faster, easily customizable and accessible and the mobile app development companies deliver them with prominent promises.

    Mobile App Designing Phoenix Az

    ReplyDelete
  40. hey this one is really a nice article and it's going to help the audience a lot. we are one of the best company in greater noida providing IOS app development services. Visit our website for more details https://www.softgains.com/ios-app-development-company-delhi-ncr.php

    ReplyDelete
  41. I acknowledge that ios app development is now in demand for many companies, which is something I understand in your blogs and I realized that the world is now become more techy because they get more interested about things that is connected to technologies.

    ReplyDelete
  42. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. Great work. seo services in kolkata | seo company in kolkata | seo service provider in kolkata | seo companies in kolkata | seo expert in kolkata | seo service in kolkata

    ReplyDelete
  43. Pride of Indian app developers who are not only skilled in their technology but also keeps their promise to create a robust code for your solutions. Hire Indian App Developer and save your money! The current scenarios of technology have raised the status of app development in India.

    ReplyDelete
  44. mobile apps development services india

    Contact one of the best teams for mobile apps development services India here with us at Dapton Consultancy Services; we are one of the best teams that help you with development of mobile apps, cloud application development, e-commerce consulting services and more. Visit us now.


    to get more - https://daptoncs.com/

    ReplyDelete
  45. Really it is very useful for us..... the information that you have shared is really useful for everyone. If someone wants to know about Cab Booking App and Cab Application I think this is the right place for you.

    ReplyDelete
  46. This comment has been removed by the author.

    ReplyDelete
  47. This comment has been removed by the author.

    ReplyDelete
  48. Are you looking for the sarkari results of the exams you have given till now?
    Finding it difficult to remember all the dates of your result?
    No worries.
    There are many websites and apps which you can look in to stay updated.
    Thanks.

    ReplyDelete
  49. This comment has been removed by the author.

    ReplyDelete
  50. The Indian App Developer is a leading IT development company for mobile applications and web development for all popular Smartphone’s, tablets and desktops. We develop Business apps, Productivity apps, Food ordering apps, E-commerce apps for iPhone, iPad and Android devices. We have been in the app development industry since 2008 and delivered more than 1000 projects to 450+ clients worldwide.

    ReplyDelete
  51. Really it is very useful for us..... the information that you have shared is really useful for everyone.

    ReplyDelete
  52. This comment has been removed by the author.

    ReplyDelete
  53. This comment has been removed by the author.

    ReplyDelete
  54. With the passing of 2019 and starting of a new beginning i.e. 2020, So many features are get manipulated and many more have been put to updations. Since the last 10 years, Web Development have seen many drastic changes. Future of web development 2020 is:
    1. AI
    2. Voice Commands
    3. Frameworks
    4. Chatbot

    ReplyDelete
  55. This is very informative blog! Keep it up. Thanks for sharing it with us Topxlisting

    ReplyDelete
  56. Thanks for sharing such useful information. To know how to book a cab on taxi booking app refer this.

    ReplyDelete
  57. This comment has been removed by the author.

    ReplyDelete
  58. Binance is a multi-chain wallet that offers extraordinary help for seven different cryptographic money assets. In the event that you’re new to the digital currency space let’s check how might you make or receive payments with Binance?

    ReplyDelete
  59. Great information shared through this post. It helps me in many ways.Thanks for posting this again. We are top Mobile App Development | Mobile App Development Company in India | Website Development Company in Delhi | Website Designing Company in Gurgaon.

    ReplyDelete
  60. Nice blog! Thanks for sharing it with us Topxlisting

    ReplyDelete
  61. An Ad Network can be referred as a middleman that connects advertisers to the publishers. The main purpose of an mobile ad network is to strike a deal between the advertiser who is looking for reputed platforms to publish his ads and an app development company who is looking for suitable ads to be published on his app. Ads display has emerged as the most beneficial way to monetize mobile apps these days.

    ReplyDelete

  62. are you looking for mobile app development company then click

    Mobile app development company in USA

    ReplyDelete
  63. Need a mobile app for your business then you can hire the top mobile app development company in USA for the best app development services.

    ReplyDelete
  64. I am a regular reader of your blog, Amazing content with proper examples. Thank you admin. Mobile App Development Outsourcing Company

    ReplyDelete
  65. Thanks for sharing this blog. It’s awesome especially for those who are the beginners in this field. Thank you once again for sharing this worthful article with us. Fintech App Development
    Wallet App Development Company

    ReplyDelete
  66. As iPad and iPhone are dominating in smartphone market; it is strategically important to make your application compatible with iOS. Indian App Developer is prominent company which provides iPhone app development India with innovative, interactive and user-friendly services in sync with your business requirement. Our highly skilled team and efficiency to develop IOS Apps that helps businesses gain their visions faster and better. Our cost-effective mobile solutions help us to serve our small & mid-sized companies and brands.

    ReplyDelete
  67. Keto Trim 800 Most purchasers fancy Keto Trim 800 due to its immediate quit result. This may be because of They Do not ought to look earlier to an Extended time to analyze their efforts return to life. So, You’re the usage of Keto Drive in case your purpose is to eliminate weight inside a totally manner this is Every quite simple and easy. Sodium In keeping with medical physician and popular health skilled Joel Fuhrman” Sodium is a in reality important mineral that is crucial for the proper typical performance of the body.” ‘Nuf aforesaid. BHB Beta-hydroxybutyrate or BHB is AN exogenous ketone that performs a assisting position into the endogenous ketones being made evidently by your frame while you input ketonemia. BHB is that the once more part of Keto Trim 800..

    Read More >>> https://www.completefoods.co/diy/recipes/what-is-the-keto-trim-800

    ReplyDelete
  68. It protects you from embarrassment and pain.
    It gives particular Bluoxyn varieties of consequences from individual to individual.
    It’s unavailable to any retail hold or well-known keep.
    You can simplest purchase this complement thru its internet internet web page.
    It’s possible to use this complement after studying its instructions
    Side Effects Of Bluoxyn:
    It is most of the best body enhancing Supplements as a manner to assist to control your hormones. Using this supplement, it's miles feasible to govern your hormones diploma too without issues. No such issue consequences are the usage of this product due to the reality all the materials used on this product are natural.
    Read News >> http://bluoxynamazon.over-blog.com/bluoxyn

    ReplyDelete
  69. There is an increasing need of on demand food delivery app development for eatery mobile application advancement. Using mobile application innovation can help restaurant proprietors cement their quality in the market. At the same time, it can help them advance their image on the web. These apps are useful in enhancing client satisfaction. Restaurant mobile apps help in sales expansion and lessening hold up time. One of the primary features of such apps is the capability for booking. There are a few mobile applications that interface clients with the nearest eateries.

    ReplyDelete
  70. This comment has been removed by the author.

    ReplyDelete
  71. Dream11 is one of the most popular and trending fantasy app in the Indian subcontinent. It has emerged to become one of the biggest names in the fantasy sports genre of mobile applications. This application is popular because it allows the participants to win some quick money. If the participants have the right knowledge and skills, they can win a significant amount of money from each game they play. Are you wondering that how to make app like Dream11? However, you must understand that it is not an easy task to start a fantasy app development project.

    ReplyDelete
  72. This comment has been removed by the author.

    ReplyDelete
  73. Digital Spider is the best Android app Development Company in Bangalore, India, which is proficient in manufacture android and ions apps. We suggest a top - class android app development services for our customer. We make inventive android apps according to market needs. Android app Development Company in Bangalore .

    ReplyDelete
  74. In this present era of digitalization, a mobile application is one of the primary necessities for today’s modern-age businesses to stand-out in the industry, including even the top Indian app developers of the market are swapping towards mobile applications rather than the ordinary websites. The applications developed through cross-platform are apparently becoming more prevalent in the market, and React Native is one of the most preferred cross-platform development solutions by the developers as it allows them to preserves native platform compatibilities through react development.

    ReplyDelete
  75. This comment has been removed by the author.

    ReplyDelete
  76. Nice and usefull information shared through this post. It helps me in many ways.Thanks for posting this again.
    We are Best Mobile App Development | Mobile App Development Companies.

    ReplyDelete
  77. Thanks for sharing the post! Unity has a large developers community. It means that you can . It means that you can easily find a reliable and experienced team of mobile game developers who use Unity to develop games.These developers always stay up to date with the latest trends happening in the mobile gaming industry and therefore can integrate the best feature to increase the engagement factor of your mobile game.

    ReplyDelete
  78. My Name is Dr Aziba Herbal Remedy is 100% guarantee for Penis Enlargement you can Contact Me via Email Priestazibasolutioncenter@gmail.com For Best natural male enhancement Product with 100% guaranteed results. I prepare top Herbal selling male enhancement product with herbal formula and no side-effects . Contact Me Via Email : Priestazibasolutioncenter@gmail.com Via WhatsApp: +2348100368288
    I also have 100% Herbal medicine to care:
    {1}HIV And AIDS
    {2}Diabetes
    {3}STD/WART
    {4}HERPES
    {5}HPV
    {7}ALS
    {8}Hepatitis

    ReplyDelete