Language Selection

English French German Italian Portuguese Spanish

Programming: WebAssembly, Mozilla GFX, Qt and Python

Filed under
Development
  • WebAssembly for speed and code reuse

    Imagine translating a non-web application, written in a high-level language, into a binary module ready for the web. This translation could be done without any change whatsoever to the non-web application's source code. A browser can download the newly translated module efficiently and execute the module in the sandbox. The executing web module can interact seamlessly with other web technologies—with JavaScript (JS) in particular. Welcome to WebAssembly.

    As befits a language with assembly in the name, WebAssembly is low-level. But this low-level character encourages optimization: the just-in-time (JIT) compiler of the browser's virtual machine can translate portable WebAssembly code into fast, platform-specific machine code. A WebAssembly module thereby becomes an executable suited for compute-bound tasks such as number crunching.

    Which high-level languages compile into WebAssembly? The list is growing, but the original candidates were C, C++, and Rust. Let's call these three the systems languages, as they are meant for systems programming and high-performance applications programming. The systems languages share two features that suit them for compilation into WebAssembly. The next section gets into the details, which sets up full code examples (in C and TypeScript) together with samples from WebAssembly's own text format language.

  • Mozilla GFX: moz://gfx newsletter #47

    Hi there! Time for another mozilla graphics newsletter. In the comments section of the previous newsletter, Michael asked about the relation between WebRender and WebGL, I’ll try give a short answer here.

    Both WebRender and WebGL need access to the GPU to do their work. At the moment both of them use the OpenGL API, either directly or through ANGLE which emulates OpenGL on top of D3D11. They, however, each work with their own OpenGL context. Frames produced with WebGL are sent to WebRender as texture handles. WebRender, at the API level, has a single entry point for images, video frames, canvases, in short for every grid of pixels in some flavor of RGB format, be them CPU-side buffers or already in GPU memory as is normally the case for WebGL. In order to share textures between separate OpenGL contexts we rely on platform-specific APIs such as EGLImage and DXGI.

    Beyond that there isn’t any fancy interaction between WebGL and WebRender. The latter sees the former as a image producer just like 2D canvases, video decoders and plain static images.

  • The Titler Revamp: QML Producer in the making

    At the beginning of this month, I started testing out the new producer as I had a good, rough structure for the producer code, and was only facing a few minor problems. Initially, I was unclear about how exactly the producer is going to be used by the titler so I took a small step back and spent some time figuring out how kdenlivetitle worked, which is the producer in use.

    Initially, I faced integration problems (which are the ones you’d normally expect) when I tried to make use of the QmlRenderer library for rendering and loading QML templates – and most of them were resolved by a simple refactoring of the QmlRenderer library source code. To give an example, the producer traditionally stores the QML template in global variables which is taken as a character pointer argument (which is, again, traditional C) The QmlRenderer lib takes a QUrl as its parameters for loading the Qml file, so to solve this problem all I had to do was to overload the loadQml() method with one which could accommodate the producer’s needs – which worked perfectly fine. As a consequence, I also had to compartmentalise (further) the rendering process so now we have 3 methods which go sequentially when we want to render something using the library ( initialiseRenderParams( ) -> prepareRenderer( ) -> renderQml( ) )

    [...]

    The problem was resolved (thank you JB) finally and it was not due to OpenGL but it was simply because I hadn’t created an QApplication for the producer (which is necessary for qt producers). The whole month’s been a steep curve, definitely not easy, but, I enjoyed it!

    Right now, I have a producer which is, now, almost complete and with a little more tweaking, will be put to use, hopefully. I’m still facing a few minor issues which I hope to resolve soon and get a working producer. Once we get that, I can start work on the Kdenlive side. Let’s hope for the best!

  • How to Make a Discord Bot in Python

    In a world where video games are so important to so many people, communication and community around games are vital. Discord offers both of those and more in one well-designed package. In this tutorial, you’ll learn how to make a Discord bot in Python so that you can make the most of this fantastic platform.

  • Qt Visual Studio Tools 2.4 RC Released

    The Visual Studio Project System is widely used as the build system of choice for C++ projects in VS. Under the hood, MSBuild provides the project file format and build framework. The Qt VS Tools make use of the extensibility of MSBuild to provide design-time and build-time integration of Qt in VS projects — toward the end of the post we have a closer look at how that integration works and what changed in the new release.

    Up to this point, the Qt VS Tools extension managed its own project settings in an isolated manner. This approach prevented the integration of Qt in Visual Studio to fully benefit from the features of VS projects and MSBuild. Significantly, it was not possible to have Qt settings vary according to the build configuration (e.g. having a different list of selected Qt modules for different configurations), including Qt itself: only one version/build of Qt could be selected and would apply to all configurations, a significant drawback in the case of multi-platform projects.

    Another important limitation that users of the Qt VS Tools have reported is the lack of support for importing Qt-related settings from shared property sheet files. This feature allows settings in VS projects to be shared within a team or organization, thus providing a single source for that information. Up to now, this was not possible to do with settings managed by the Qt VS Tools.

More in Tux Machines

6 Best Free Linux Web Caches

Hypertext Transfer Protocol (HTTP) is considered to be the fundamental protocol of the web. This simple request/response protocol is used for distributed, collaborative, hypermedia information systems. The web consumes a large portion of internet traffic. With HTTP, a client makes a request for a resource to a server, and the server delivers messages with additional content such as images, style sheets and JavaScript. HTTP dictates how these messages are displayed and transmitted, and how web servers and browsers should respond to various commands. The developers of the HTTP protocol realized at an early stage that there was going to be rapid growth in web traffic. This continues to be the case. Read more

KDE Plasma 5.20 Beta is out. Final Release Next Month.

The next installment of the Plasma desktop environment, KDE Plasma 5.20 Beta released. The final release is expected on October 13, 2020. Read more

today's leftovers

  • Submit a KSyntaxHighlighting Color Theme

    The KSyntaxHighlighting framework provides support for color themes. These color themes specify all colors (text/background/selection/…) and font style roles (italic/bold/…) that are used for the highlighting. The definition happens in some easy to understand JSON file format. Starting with the upcoming KDE Frameworks 5.75 release, all KTextEditor framework based application will support these color themes for their embedded editors. This includes Kate & KWrite, but naturally a lot more, like for example KDevelop, Kile and RKWard. [...] With the recent additions we already cover some more well known text editor color themes. But if you just search a bit around the internet or look what other text editors ship per default, we still lack a lot of well known ones. For example even our GitLab instance provides the Monokai theme in the configuration for its web highlighting that we still lack. Therefore, we are eager to get submissions for more MIT licensed color themes we can bundle with KSyntaxHighlighting. All users of applications using this framework will enjoy to be able to choose between more themes with ease if you help us! Therefore, take the chance and help us out, provide some more themes as merge request. License must be MIT, this seems to be no problem for most themes out there, at least it seems most of the ones I stumbled over are MIT licensed.

  • FreeBSD Instant-workstation 2020

    A little over a year ago I published an instant-workstation script for FreeBSD. The idea is to have an installed FreeBSD system, then run a shell script that uses only base-system utilities and installs and configures a workstation setup for you. [...] The script is updated intermittently when new PRs come in, or when I have to reinstall a machine and things do not behave the way I think they should. If you want a quick live KDE Plasma experience with FreeBSD, head on over to FuryBSD which does live ISO images with a variety of environments.

  • Three tips to implement Kubernetes with open standards

    The technologies chosen by enterprise IT departments today will have a long-term impact on their performance, operations and overall strategy. Sometimes it can take well over a decade to realize the full implications of a technology solution. This can put a great deal of weight on the shoulders of IT management, especially when it comes to emergent technologies whose utility, importance and trajectory may not yet be fully known. Placing a bad bet on new software can lead to difficult integrations and disruptions across an organisation’s entire tech stack, which in the long-term can lead to lost productivity, wasted budgets, and the likelihood of losing ground to competitors. Kubernetes, the open source container orchestration platform, was until recently regarded in the same way, with IT departments struggling to fully appraise its long-term value. However, with Kubernetes now running 86 per cent of container clusters, it has emerged as the de facto standard for cloud-native infrastructure. This means that the main concern for IT departments is not whether Kubernetes has a future, but how to ensure that their implementation of Kubernetes has a future which doesn't present a bottleneck to integrations, industry practices and use cases.

  • openSUSE Tumbleweed – Review of the week 2020/38

    An average week, with an average number of 5 snapshots (0910, 0914, 0915, 0916, and 0917 – with 0917 just being synced out). The content of these snapshots included: KDE Applications 20.08.1 Qt 5.15.1 PackageKit 1.2.1 Systemd 246.4 Virt-Manager 3.0.0

  • Whonix 15.0.1.5.1 - for VirtualBox - Point Release!
  • The Expandables – snapcraft extensions and the secret code

    If you’re a snap developer, you know that snap development is terribly easy. Or rather complex and difficult. Depending on your application code and requirements, it can take a lot of effort putting together the snapcraft.yaml file from which you will build your snap. One of our goals is to make snap development practically easier and more predictable for everyone. To that end, we created a framework of snap extensions, designed to make the snap journey simpler and more fun. In a nutshell, extensions abstract away a range of common code declarations you would normally put in your snapcraft.yaml file. They help developers avoid repetitive tasks, reduce the knowledge barrier needed to successfully build snaps, offer a common template for application builds, and most importantly, save time and effort. But what if you want – or need – to know what is behind the abstraction?

  • DeskProto® releases free CAM software for Linux

    Delft Spline Systems announces that the DeskProto CAM software now also is available for Linux users, as native 64 bits AppImage file that will work on various Linux distributions. Projects made on Linux, on Mac and Windows are interchangeable. Licenses for DeskProto V7 can be used to activate DeskProto on all three platforms, so existing users can switch to a Linux without extra cost.

  •      
  • Tor’s Bug Smash Fund, Year 2: $106,709 Raised!
           
             

    Let’s start this post with a rousing THANK YOU to the Tor community!

             

    This August, we asked you to help us fundraise for our second annual Bug Smash Fund campaign. This fund is designed to grow a healthy reserve earmarked for maintenance work, finding bugs, and smashing them—all tasks necessary to keep Tor Browser, the Tor network, and the many tools that rely on Tor strong, safe, and running smoothly.

  •        
  • Researchers were able to figure out which American phone numbers use Signal
           
             

    Privacy flaws in contact discovery have led to a research team being able to enumerate all American Signal users. Enumeration means that using the contact discovery built into the Signal app, researchers were able to perform a large-scale crawling attack and figure out which American phone numbers were attached to a Signal account. The new research paper was released by Christoph Hagen, Christian Weinert, Christoph Sendner, Alexandra Dmitrienko, and Thomas Schneider. It is titled: “All the Numbers are US: Large-scale Abuse of Contact Discovery in Mobile Messengers.”

  • The ’90s are back: Gateway laptops have been resurrected as Walmart exclusives

    Remember Gateway laptops? If you grew up in the ’90s, they were probably the brand of your first laptop. Like a revival of your favorite childhood television show, the Gateway brand has been raised from the dead — cow imagery and all. The brand, which is owned by computer maker Acer, is making its own comeback with a line of new laptops, tablets, and convertibles that will be exclusive to Walmart.

    So, what’s forcing these cows out of hibernation? For Gateway parent Acer, its about new silicon from Intel and AMD, including the successsul new mobile Ryzen 4000 processors.

The Top 50 Programming Languages to Learn Coding

Gone are the days when a handful of people were considered as top computer programmers and developers. The dawn of the digital age has now made it possible to everyone to play with codes and write a computer program. What all this need is to have a solid grasp of emerging technology and programming languages. However, it is not as easy as it seems since there are a large number of programming languages out there and choosing one and master in it might be challenging. Thus, before getting started into the world of coding, you must make the right choice and come up with the one that best suited for you. Read more Also: How to use C++ Pointers