Programming Languages

Distribute your microservices data with events, CQRS, and event sourcing

Distribute your microservices data with events, CQRS, and event sourcing

DevNation Tech Talks are hosted by the Red Hat technologists who create our products. These sessions include real solutions plus code and sample projects to help you get started. In this talk, you’ll learn about distributing your microservices data with events, Command Query Responsibility Segregation (CQRS), and event sourcing from Edson Yanaga, Red Hat’s Director of Developer Experience.

Continue reading Distribute your microservices data with events, CQRS, and event sourcing

Share
Red Hat XML language server becomes LemMinX, bringing new release and updated VS Code XML extension

Red Hat XML language server becomes LemMinX, bringing new release and updated VS Code XML extension

A new era has begun for Red Hat’s XML language server, which was migrated to the Eclipse Foundation under a new project name: Eclipse LemMinX (a reference to the Lemmings video game). The Eclipse LemMinX project is arguably the most feature-rich XML language server available. Its migration opens more doors for future development and utilization. In addition, shortly after its migration, the Eclipse LemMinX project and Red Hat also released updates: Eclipse LemMinX version 0.11.1 and the Red Hat VS Code XML extension.

Continue reading Red Hat XML language server becomes LemMinX, bringing new release and updated VS Code XML extension

Share
Static analysis in GCC 10

Static analysis in GCC 10

I work at Red Hat on GCC, the GNU Compiler Collection. For the next major release of GCC, GCC 10, I’ve been implementing a new -fanalyzer option: A static analysis pass to identify various problems at compile-time, rather than at runtime.

My thinking here is that it’s best to catch problems as early as possible as the code is written, using the compiler the code is written in as part of the compile-edit-debug cycle, rather than having static analysis as an extra tool “on the side” (perhaps proprietary). Hence, it seems worthwhile to have a static analyzer built into the compiler that can see exactly the same code as the compiler sees—because it is the compiler.

Continue reading “Static analysis in GCC 10”

Share
Red Hat Universal Base Images for Docker users

Red Hat Universal Base Images for Docker users

Red Hat Universal Base Images (UBIs) allow developers using Docker on Windows and Mac platforms to tap into the benefits of the large Red Hat ecosystem. This article demonstrates how to use Red Hat Universal Base Images with Docker from a non-Red Hat system, such as a Windows or Mac workstation.

Red Hat Enterprise Linux and Docker

When Red Hat Enterprise Linux (RHEL) 8 was released almost a year ago, and it came with lots of new features related to containers. The biggest ones were the new container tools (Podman, Buildah, and skopeo) and the new Red Hat Universal Base Images. There was also confusion because RHEL 8 dropped support for the Docker toolset. Some developers thought that they could not work with Docker anymore, and had to either migrate to a Red Hat-ecosystem Linux system such as CentOS or stay away from Red Hat customers.

Continue reading “Red Hat Universal Base Images for Docker users”

Share
Kogito 0.8.0 features online editors and cloud-native business automation

Kogito 0.8.0 features online editors and cloud-native business automation

Kogito is a cloud-native business automation solution that offers a powerful, developer-friendly experience. Based on production-tested open source projects Drools and jBPM, Kogito has business rules and processes down to a science. Kogito also aligns with popular lightweight runtimes such as Quarkus and Spring Boot to support developers building business-driven applications.

This article is an overview of the new enhancements for Kogito 0.8.0, which was released on March 10, 2020.

Continue reading “Kogito 0.8.0 features online editors and cloud-native business automation”

Share
Cross-language link-time optimization using Red Hat Developer Tools

Cross-language link-time optimization using Red Hat Developer Tools

Several months ago, the LLVM project blog published an article, Closing the gap: cross-language LTO between Rust and C/C++. In it, they explained that link-time optimization can improve performance by optimizing throughout the whole program, such as inlining function calls between different objects. Since Rust and Clang both use LLVM for code generation, we can even achieve this benefit across different programming languages.

In Red Hat Developer Tools, we have the Rust and LLVM Toolsets, which can easily be used together for cross-language link-time optimization (LTO), so let’s try it out.

Continue reading “Cross-language link-time optimization using Red Hat Developer Tools”

Share
How to use the new Kafka Client API for Kafka-specific message properties in Open Liberty 20.0.0.3

How to use the new Kafka Client API for Kafka-specific message properties in Open Liberty 20.0.0.3

In Open Liberty 20.0.0.3, you can now access Kafka-specific properties such as the message key and message headers, rather than just the message payload, as was the case with the basic MicroProfile Reactive Messaging Message API. Also, you can now set the SameSite attribute in the session cookie, the LTPA, and JWT cookies as well as in application-defined cookies.

Continue reading How to use the new Kafka Client API for Kafka-specific message properties in Open Liberty 20.0.0.3

Share
Extending gdbserver to support an strace client

Extending gdbserver to support an strace client

The strace command traces system calls and signals, deciding them and their corresponding arguments into a symbolic form. A frequent debugging request from developers is the ability to allow strace to trace system calls for a program that is also being debugged by GDB, like this:

% gdb --args test-program
(gdb) b main
Breakpoint 1 at 0x40128e: file test-program.c, line 22.
(gdb) run
Starting program: test-program
Breakpoint 1, main (argc=3, argv=0x7fffffffdb98) at test-program.c:22
22 int thread_count = 2;
(gdb)

In another terminal window, we invoke strace on the same process GDB is debugging:

% strace -p $(pgrep -f test-program)
strace: attach: ptrace(PTRACE_SEIZE, 27882): Operation not permitted

The culprit here is that the ptrace system call, which is used by both GDB and strace to control the execution of programs, and does not allow both strace and GDB to control the same process.

Continue reading “Extending gdbserver to support an strace client”

Share
Possible issues with debugging and inspecting compiler-optimized binaries

Possible issues with debugging and inspecting compiler-optimized binaries

Developers think of their programs as a serial sequence of operations running as written in the original source code. However, program source code is just a specification for computations. The compiler analyzes the source code and determines if changes to the specified operations will yield the same visible results but be more efficient. It will eliminate operations that are ultimately not visible, and rearrange operations to extract more parallelism and hide latency. These differences between the original program’s source code and the optimized binary that actually runs might be visible when inspecting the execution of the optimized binary via tools like GDB and SystemTap.

To aid with the debugging and instrumentation of binaries the compiler generates debug information to map between the source code and executable binary. The debug information includes which line of source code each machine instruction is associated with, where the variables are located, and how to unwind the stack to get a backtrace of function calls. However, even with the compiler generating this information, a number of non-intuitive effects might be observed when instrumenting a compiler-optimized binary:

Continue reading “Possible issues with debugging and inspecting compiler-optimized binaries”

Share