ProgrammingPro #10: GPT4Tools, Rust 1.70.0, Self-Healing Code, and Common Program Layouts
Hi,
Hello and welcome to the next installment of the ProgrammingPro newsletter where we detail the most relevant industry insights, actionable and practical tutorials, and useful resources for developers and engineers.
In today’s issue you will look at trending AI tools and LLMs such as GPT4Tools - Controlling Visual Foundation Models. In addition, you’ll also come across a unique perspective on why Self-Healing Code is the Future of Software Development, and an assortment of the most relevant industry insights, including the upcoming release of JDK 21.
Also, in today’s issue:
TechWave: News and Analysis
Secret Knowledge: Learning Resources
HackerHub: New AI/LLM Tools
Tutorial: Commonly Used Program Layout for Robust Applications
My promise with this newsletter is to act as your personal assistant and help you navigate and keep up-to-date with what's happening in the world of software development. What did you think of today's newsletter? Please consider taking the short survey below to share your thoughts and you will get a free PDF of the “Cybersecurity: The Beginner's Guide” eBook upon completion.
Thanks for reading.
Kartikey Pandey
Editor-in-Chief
Writer’s Credit: Special shout-out to Kirolos Youssef for his valuable contribution to this newsletter’s content!
Complete the Survey, Get a Packt eBook Free!
⚡ TechWave: News and Analysis
MIT Small-Scale Language Model: Traditionally, software developers hold the belief that smaller language models possess more limited capabilities compared to their larger counterparts. However, researchers at MIT made significant advances in this regard by developing a Small-Scale Language Model that outperforms similar Large Scale language models by up to 500 times in specific language understanding tasks.
OpenAI Grant Program: OpenAI launched this week Cybersecurity Grant Program. The main objective of the program is to stimulate the development and application of AI in the field of cybersecurity and promote meaningful conversations among experts in both disciplines.
JDK 21: Oracle's standard Java implementation is set to release its next long-term support version in September. Sixteen features are officially proposed for it with three more features added this week. The latest proposed features include the preview of structured concurrency, scoped values and preparations to disallow dynamic loading of agents. These features are intended to enhance the functionality and capabilities of Java.
Rust 1.70.0: Rust was designed to make it easy to develop fast and secure system-level software. This week the rust team announced the official release of the latest version. This release brings notable improvements in terms of performance when retrieving information from the crates.io index. Additionally, two types, OnceCell and its thread-safe counterpart OneLock, have been stabilized to enable one-time initialization of shared data. Furthermore, a number of APIs have been stabilized.
WWDC 2023: Apple’s worldwide developer confererence is held this week from June 5-9. The conference serves as a platform to provide developers with an in-depth view of the new technologies and latest updates. The blog post in the link offers minute by minute announcements and coverage of the event. You can follow up with the newly released products as Apple VR headset and Macbook Air as well as the latest released operating system for augmented reality.
Secret Knowledge: Learning Resources
Self-Healing Code is the Future of Software Development: This post looks at a more realistic future of software development with AI. It pulls real world examples of how companies are using AI, such as Google using ML-based suggestions from code review comments. The post covers the landscape of coding from code creation, bug detection, testing, linting, maintainability, and more.
Junior to Senior - An Action Plan for Engineering Career Success: GitHub has published a guide to help junior engineers plan their career to get to a senior engineer position. This guide covers the key technical competencies that managers prioritize for career advancement, the essential communication skills expected from senior developers, and how to approach code development with a focus on addressing business requirements.
Steering LLMs with Prompt Engineering: Prompt Engineering is the process of creating and evaluation of high quality prompts to guide language models. In this tutorial, you will understand how to write a program that can design your prompts and use them to influence the response of language models.
Parallelism in JavaScript: Parallelism is the art of effectively using available resources to enhance performance and scalability. This tutorial aims to address a common misconception among Java programmers regarding the implementation of parallelism. It demonstrates an approach to achieve parallelism in web applications using Java and includes a section about limitations and considerations associated with the described approach.
AI Does Not Help Programmers: This article argues that AI does not help programmers and that it is not a silver bullet for software development. He cites several reasons for this, including the fact that AI is not always accurate, can be difficult to integrate into existing workflows, and can be expensive to implement.
HackerHub: LLM Tools & Launches
GPT4Tools - Controlling Visual Foundation Models: The new GPT4Tools system can manage multiple visual foundation models by analyzing language content, allowing it to automatically decide, control, and use different models based on the user's needs during a conversation.
Ruby SHell: The Ruby SHell features aliases, syntax highlighting, tab completions, command suggestions, history, a full set of Ruby commands, and much more.
MineDojo/Voyager: Voyager is the first LLM-powered embodied lifelong learning agent in Minecraft that continuously explores the world and makes novel discoveries without human intervention.
huggingface/accelerate: A simple way to train and use PyTorch models with multi-GPU, TPU, mixed-precision.
kyegomez/tree-of-thoughts: Tree of Thoughts (ToT) is an all-new powerful and flexible algorithm that advances model reasoning by a whopping 70%.
explosion/spaCy: It features state-of-the-art speed and neural network models for tagging, parsing, named entity recognition, text classification and more.
Aviary: Aviary is an app that lets you interact with a variety of large language models (LLMs) in a single place. You can compare the outputs of different models directly, rank them by quality, get a cost and latency estimate, and more.
Tutorial: Commonly Used Program Layouts for Robust Applications
Along your programming journey, you may come across many different structures for applications. There is no standard programming layout for Go. Given all this freedom, however, the choice of the structure must be carefully made because it will dictate whether we understand and know how to maintain our application. The proper structure for the application will ideally also be simple, easy to test, and directly reflect the business design and how the code works.
When choosing a structure for your Go application, use your best judgment. Do not choose arbitrarily. Listen to the advice in context and learn to justify your choices.
There’s no reason to choose a structure early, as your code will evolve over time and some structures work better for small applications while others are better for medium to large applications.
Program layouts
Let’s dig into some common and emerging structural patterns that have been developed for the Go language so far. Understanding each option will help you choose the best design structure for your next application.
Flat structure
This is the simplest structure to start with and is the most common when you are starting with an application, only have a small number of files, and are still learning about the requirements. It’s much easier to evolve a flat structure into a modular structure, so it’s best to keep it simple at the start and partition it out later as the project grows.
Let us now see some advantages and disadvantages of this structure:
Pros:
It’s great for small applications and libraries
There are no circular dependencies
It’s easy to refactor into a modular structure
Cons:
This can be complex and disorganized as the project grows
Everything can be accessed and modified by everything else
Example
As the name implies, all the files reside in the root directory in a flat structure. There is no hierarchy or organization and this works well when there is a small number of files:
As your project grows, there are several different ways to group your code to keep it organized, each with its advantages and disadvantages.
Grouping code by function
Code is separated by its similar functionality. In a Go REST API project, as an example, Go files are commonly grouped by handlers and models.
Let us now see some advantages and disadvantages of this structure:
Pros:
It’s easy to refactor your code into other modular structures
It’s easy to organize
It discourages a global state
Cons:
Shared variables or functionality may not have a clear place to live
It can be unclear where initialization occurs
To mitigate any confusion that can occur, it’s best to follow Go best practices. If you choose the group-by-function structure, use the main.go file to initialize the application from the project root. This structure, as implied by the name, separates code based on its function…
This tutorial is a content extract from the book Building CLI Applications in Go written by Marian Montagnino and published by Packt Publishing.