Open-source News

FEX 2211 Emulator Gets God of War & Other Modern AAA Games Running On Linux AArch64

Phoronix - Thu, 11/03/2022 - 18:15
Making good progress this year has been the open-source FEX-Emu emulator for running x86/x86_64 Linux binaries on 64-bit Arm (AArch64). This isn't only for running Linux x86_64 applications on Arm but with Steam and Steam Play (Proton) can mean running Windows games on Linux 64-bit Arm. With FEX 2211 out today more progress has been made on the Proton front for getting more modern games running...

Intel's Open-Source Arc Graphics Driver Not Yet Working On POWER Hardware

Phoronix - Thu, 11/03/2022 - 17:30
Besides open-source drivers being loved by Linux enthusiasts for the greater technical clarity/insight, better security with the ability to verify the driver's behavior, and better durability of the driver over the longer-term, another common open-source driver benefit is being able to get the drivers working on other CPU architectures not otherwise a focus by the upstream hardware vendor. With Intel's open-source graphics driver stack for Arc Graphics and also in the data center with the Data Center GPU Flex Series and forthcoming Ponte Vecchio, it's drawn interest from ARM, RISC-V, and POWER folks. Unfortunately at least in the case of the POWER9 hardware, the current Intel Linux graphics driver isn't yet building properly there...

Microsoft Adding Nested MSHV Hypervisor Support To Linux

Phoronix - Thu, 11/03/2022 - 17:25
The latest patches from Microsoft for the Linux kernel are for extending the kernel's support to allow running on a nested Microsoft (MSHV) hypervisor...

Linux 6.2 To Put The Raspberry Pi In Good Shape For 4K @ 60Hz Displays

Phoronix - Thu, 11/03/2022 - 17:08
Since last year have been patches enabling the Raspberry Pi to output at 4K with a 60Hz refresh rate. But since Linux 5.18 at least some of the 4K handling had regressed for this budget Arm single board computer. With the Linux 6.2 cycle in December there are several 4K related improvements to the Raspberry Pi open-source display driver for addressing that prior regression as well as making the 4K monitor handling more robust...

Panfrost Gallium3D Driver Wires Up Mesa Shader Disk Cache Support

Phoronix - Thu, 11/03/2022 - 16:53
One of the last features to land in Mesa 22.3 prior to yesterday's branching and Mesa 22.3-rc1 release is enabling the Mesa shader disk cache for Panfrost, the Arm Mali open-source driver for Midgard and Bifrost generations...

How to Install VirtualBox 7.0 in RHEL 9/8

Tecmint - Thu, 11/03/2022 - 16:02
The post How to Install VirtualBox 7.0 in RHEL 9/8 first appeared on Tecmint: Linux Howtos, Tutorials & Guides .

Brief: In this tutorial, we look at how to install VirtualBox 7.0 in RHEL 9 and RHEL 8 distributions to create guest virtual machines using an ISO image file. Oracle VM VirtualBox is a

The post How to Install VirtualBox 7.0 in RHEL 9/8 first appeared on Tecmint: Linux Howtos, Tutorials & Guides.

Is Lua worth learning?

opensource.com - Thu, 11/03/2022 - 15:00
Is Lua worth learning? Seth Kenlon Thu, 11/03/2022 - 03:00

Lua is a scripting language used for procedural programming, functional programming, and even object-oriented programming. It uses a C-like syntax, but is dynamically typed, features automatic memory management and garbage collection, and runs by interpreting bytecode with a register-based virtual machine. This makes it a great language for beginners, but also a powerful tool for experienced programmers.

Lua has been somewhat eclipsed from the public view by languages like Python and JavaScript, but Lua has several advantages that make it popular in some major software projects. Lua is easily embedded within other languages, meaning that you can include Lua files in the code base of something written in (for instance) Java and it runs as if it were native Java code. It sounds like magic, but of course there are projects like luaj working to make it possible, and it's only possible because Lua is designed for it. It's partly because of this flexibility that you're likely to find Lua as the scripting language for video games, graphic applications, and more.

As with anything, it takes time to perfect, but Lua is easy (and fun) to learn. It's a consistent language, a friendly language with useful error messages, and there's lots of great support online. Ready to get started?

Installing Lua

On Linux, you can install Lua using your distribution's package manager. For instance, on Fedora, CentOS, Mageia, OpenMandriva, and similar distributions:

$ sudo dnf install lua

On Debian and Debian-based systems:

$ sudo apt install lua

For Mac, you can use MacPorts or Homebrew.

$ sudo port install lua

For Windows, install Lua using Chocolatey.

To test Lua in an interactive interpreter, type lua in a terminal.

Functions

As with many programming languages, Lua syntax generally involves a built-in function or keyword, followed by an argument. For instance, the print function displays any argument you provide to it.

$ lua Lua 5.4.2 Copyright (C) 1994-2020 Lua.org, PUC-Rio > print('hello') hello

Lua's string library can manipulate words (called "strings" in programming.) For instance, to count the letters in a string, you use the len function of the string library:

> string.len('hello') 5Variables

A variable allows you to create a special place in your computer's memory for temporary data. You can create variables in Lua by inventing a name for your variable, and then putting some data into it.

> foo = "hello world" > print(foo) hello world > bar = 1+2 > print(bar) 3

Programming and development Red Hat Developers Blog Programming cheat sheets Try for free: Red Hat Learning Subscription eBook: An introduction to programming with Bash Bash shell scripting cheat sheet eBook: Modernizing Enterprise Java An open source developer's guide to building applications Tables

Second only to the popularity of variables in programming is the popularity of arrays. The word "array" literally means an arrangement, and that's all a programming array is. It's a specific arrangement of data, and because there is an arrangement, an array has the advantage of being structured. An array is often used to perform essentially the same purpose as a variable, except that an array can enforce an order to its data. In Lua, an array is called a table.

Creating a table is like creating a variable, except that you set its initial content to two braces ({}):

> mytable = {}

When you add data to a table, it's also a lot like creating a variable, except that your variable name always begins with the name of the table, and is separated with a dot:

> mytable.foo = "hello world" > mytable.bar = 1+2 > print(mytable.foo) hello world > print(mytable.bar) 3Scripting with Lua

Running Lua in the terminal is great for getting instant feedback, but it's more useful to run Lua as a script. A Lua script is just a text file containing Lua code, which the Lua command can interpret and execute.

The eternal question, when just starting to learn a programming language, is how you're supposed to know what to write. This article has provided a good start, but so far you only know two or three Lua functions. The key, of course, is in documentation. The Lua language isn't that complex, and it's very reasonable to refer to the Lua documentation site for a list of keywords and functions.

Here's a practice problem.

Suppose you want to write a Lua script that counts words in a sentence. As with many programming challenges, there are many ways to go about this, but say the first relevant function you find in the Lua docs is string.gmatch, which can search for a specific character in a string. Words are usually separated by an empty space, so you decide that counting spaces + 1 ought to render a reasonably accurate count of the words they're separating.

Here's the code for that function:

function wc(words,delimiter) count=1 for w in string.gmatch(words, delimiter) do count = count + 1 end return count end

These are the components of that sample code:

  • function: A keyword declaring the start of a function. A custom function works basically the same way as built-in functions (like print and string.len.)

  • words and delimiter: Arguments required for the function to run. In the statement print('hello'), the word hello is an argument.

  • counter: A variable set to 1.

  • for: A loop using the string.gmatch function as it iterates over the words you've input into the function, and searches for the delimiter you've input.

  • count = count +1: For each delimiter found, the value of count is re-set to its current value plus 1.

  • end: A keyword ending the for loop.

  • return count: This function outputs (or returns) the contents of the count variable.

  • end: A keyword ending the function.

Now that you've created a function all your own, you can use it. That's an important thing to remember about a function. It doesn't run on its own. It waits for you to call it in your code.

Type this sample code into a text file and save it as words.lua:

function wc(words,delimiter) count=1 for w in string.gmatch(words, delimiter) do count = count + 1 end return count end result = wc('zombie apocalypse', ' ') print(result) result = wc('ice cream sandwich', ' ') print(result) result = wc('can you find the bug? ', ' ') print(result)

You've just created a Lua script. You can run it with Lua. Can you find the problem with this method of counting words?

$ lua ./words.lua 2 3 6

You might notice that the count is incorrect for the final phrase because there's a trailing space in the argument. Lua correctly detected the space and tallied it into count, but the word count is incorrect because that particular space happens not to delimit a word. I leave it to you to solve that problem, or to find other ways in which this method isn't ideal. There's a lot of rumination in programming. Sometimes it's purely academic, and other times it's a question of whether an application works at all.

Learning Lua

Lua is a fun and robust language, with progressive improvements made with each release, and an ever-growing developer base. You can use Lua as a utilitarian language for personal scripts, or to advance your career, or just as an experiment in learning a new language. Give it a try, and see what Lua brings to the table.

Lua is a fun and robust language, with progressive improvements made with each release, and an ever-growing developer base. Discover all of its possibilities.

Image by:

Ray Smith

Programming What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

How open source weaves connections between countries

opensource.com - Thu, 11/03/2022 - 15:00
How open source weaves connections between countries Phil Shapiro Thu, 11/03/2022 - 03:00

Long ago, when I was a tech administrator for Arlington Public Schools, I received an unexpected email saying, "Our school in India loves your children's stories, so we've printed them all out in braille."

Apparently, the school had found my collection of children's stories on the web. I spent a moment visualizing those students so far away, enjoying my stories on those printed pages of braille. The email's sender might not have realized how meaningful their email was to me, but it's stayed with me for two decades.

Tell collaborative stories with open source

That experience got me thinking about how technology can weave new connections between people in different countries. While surfing the web recently, I encountered an Inkscape enthusiast in Romania. His talent with the software was obvious.

You might not think of Romania as a tech hub, but people have all kinds of tech talent there. Talent exists everywhere. Open source, accessible to anyone who downloads it, can serve as a connector between cultures and countries. This enthusiast was having a fabulous time honing his skills using Inkscape, one of today's premier illustration tools—and it doesn't cost anything. He and I had something in common—something that could foster a friendship.

I then became curious whether the Opensource.com website gets regular web visits from Romania. A quick email to the staff confirmed that, yes, their website logs show regular visits from Romania. In fact, Opensource.com gets more monthly web visits from Romania than from Denmark, Norway, and New Zealand. Would you be surprised to learn that Opensource.com receives a lot of web traffic from Indonesia? I find that statistic delightful because it points towards a smaller world—a more inclusive, multicultural world.

My thoughts about open source as a global connector awakened again last month when I found out about an open source, web-based motion graphics editor named Motionity. The software was created by a software developer in Great Britain and she describes it as "a mix of Canva and Adobe After Effects."

This application is immensely exciting. I can envision my lighthearted, whimsical story, Ellen the Eagle Needs Glasses, drawn in Inkscape and brought to life using Motionity. To honor AlyssaX's programming work, we must find ways to use her software that showcase what it can do. If you're an illustrator or animator, get in touch with me—even better, surprise me with your finished creative project created using Inkscape and Motionity.

Explore Motionity for whatever uses you might have. Surprise AlyssaX with your best creative work. I want AlyssaX to experience the same feeling I had when I received that one-sentence email from India.

(Our language does not currently have a word for that kind of experience, but maybe we ought to coin a word. If you coin such a word, please tell me.)

More great content Free online course: RHEL technical overview Learn advanced Linux commands Download cheat sheets Find an open source alternative Explore open source resources Forge global friendships

Fifteen years ago, I attended an international conference on wireless community networks. At that conference, I participated in a session explaining the workings of Serbia Wireless, a nonprofit grassroots community wireless network. One of the young presenters was from Serbia, and another was from Bosnia. I quickly understood its significance when I heard what they were doing with their homebrew wireless community network. These two young people were using open source hardware and open source software to blur the national boundary lines between the two previously warring nations. I honestly wanted to jump up and cheer when their motivation became apparent. After their session, I grabbed one of the presenters, Bogdan Tancic, for this six-minute video interview. Listen carefully to what he has to say.

Make connections

If you're looking for something meaningful to do in your life, find ways of connecting with people in different countries. Help these individuals cherish their cross-national friendships. If these new connections are grown repeatedly, the world would be an immeasurably better place. Open source is an outstanding tool to make that happen.

What are your own cross-national open source stories? Share your stories right here on Opensource.com.

If global friendships are grown repeatedly, the world would be an immeasurably better place. Open source is an outstanding tool to make that happen.

Image by:

Opensource.com

Accessibility What to read next New open source tool catalogs African language resources Global communication in open source projects This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

Mesa 22.3-rc1 Released With Rusticl, Many Intel & Radeon Vulkan Driver Improvements

Phoronix - Thu, 11/03/2022 - 06:35
Feature work on Mesa 22.3 has now concluded as this quarter's feature release to this collection of open-source OpenGL, OpenCL, and Vulkan drivers. Mesa 22.3 was branched this afternoon and Mesa 22.3-rc1 now issued as the first weekly test release leading up to the stable debut in a few weeks...

Open-Source AMD Linux Driver Gets Ready For 50% More VGPRs With RDNA3

Phoronix - Thu, 11/03/2022 - 02:00
Ahead of AMD's RDNA3 announcement for tomorrow, 3 November, the Mesa 22.3 open-source Radeon graphics driver code continues seeing more RDNA3/GFX11 enablement work landing...

Pages