Skip to content

Commit

Permalink
more blog improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoreilly committed Jul 15, 2024
1 parent 3f093a4 commit 41286a7
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions content/blog/-2024-07-17-initial-release.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# Initial release

Today we are announcing the initial public beta release of the Cogent Core GUI framework. Cogent Core takes seriously the idea that you can "Code Once, Run Everywhere", and indeed you are reading this blog using a Core app running on the web, via wasm (web assembly). The same code can run on all major desktop and mobile platforms as well, and we include a `core` tool that manages all the details for running and building apps for each of these different platforms.
Today we are announcing the initial public beta release of the Cogent Core GUI framework. Cogent Core prioritizes the ability to Code Once, Run Everywhere (Core), and indeed you are reading this blog in a Cogent Core app running on the web via wasm (web assembly). The same code can run on macOS, Windows, Linux, iOS, Android, and the Web through a `core` command line tool that manages all the details for running and building apps for each of those different platforms.

Cogent Core is written in Go (Golang), and inherits much of its best features from this amazing language, and its associated tooling ecosystem. Go code is simple, easy to read and write, and emphasizes a minimalist approach that eschews as much of the extra syntax and boilerplate stuff that clutters so many other languages.
Cogent Core is written in Go (Golang), and inherits many of its best features from this amazing language and its associated ecosystem. Go code is simple, easy to read and write, and emphasizes a minimalist approach that eschews as much of the extra syntax and boilerplate stuff that clutters so many other languages.

Here's a simple "hello world" app in Cogent Core:
Here's a simple hello world app in Cogent Core:

```Go
package main

import "cogentcore.org/core/core"

func main() {
b := core.NewBody("Hello")
b := core.NewBody()
core.NewButton(b).SetText("Hello, World!")
b.RunMainWindow()
}
```

See that `Hello World!` button up there? That is a "live" rendering of the code shown in the text editor box above. Go ahead, and change the message, and hit `Control+Enter` or just click off, and you'll see it update!
See that "Hello, World!" button up there? That is a live rendering of the code shown in the text editor above. You can change the message, press `Control+Enter` or just click off, and you'll see it update!

Cogent Core supports all the usual types of GUI Widgets, along with some fairly advanced elements not found in other frameworks. We encourage a trip to the main docs page, which provides interactive, editable examples of all major elements: https://www.cogentcore.org/core/ (it is also a Cogent Core app running in wasm).
Cogent Core supports all the usual types of GUI widgets, along with some fairly advanced ones not found in other frameworks. We encourage a trip to the main [docs](https://www.cogentcore.org/core) page, which provides interactive, editable examples of all major widgets (it is also a Cogent Core app running via wasm).

Here's a small sample of some of the widgets, and a few things you can do with them:

Expand All @@ -37,6 +37,7 @@ spin.OnChange(func (e events.Event) {
slide.SetValue(value)
slide.Update()
})
core.NewColorButton(b).SetColor(colors.Orange)

type language struct {
Name string
Expand Down Expand Up @@ -83,23 +84,23 @@ pe.ColumnOptions("Population").On = true

* Focus on efficient keyboard navigation and customizable mappings, with full support for emacs mode.

...
*add more...*

## Our Story

The open source world is full of half-baked abandonware, especially in the world of GUI frameworks. And writing any kind of significant application in a given GUI framework inevitably requires a lot of time and effort (even with something as easy-to-use as Cogent Core), so it is reasonable to be very cautious in investing in a given framework, lest this common fate befall it and take your project down with it.

Therefore, we think it is important to tell you a bit about where Cogent Core came from, and where we want it to go in the future, and why we are committed to supporting it and growing a full software ecosystem around it.

The initial version of this software was named "GoKi", and it was written in 2018 by Professor Randy O'Reilly to enable him to develop advanced neural network models of the brain using Go, instead of C++. He had grown increasingly frustrated with the long build times and tiresome boilerplate involved in coding in C++. Python is, by itself, too slow for the actual numerical simulation code, so it inevitably serves as a wrapper around the same dreaded C++, resulting in a complex and unpleasant combination of two languages. Go, by contrast, compiles nearly instantly, and runs nearly as fast as C++. The small difference in compute time (less than 5-10%) was more than made up for by the massive increase in coding efficiency and overall happiness from using Go.
The initial version of this software was named "GoKi", and it was written in 2018 by Professor Randy O'Reilly to enable him to develop advanced [neural network models](https://emersim.org) of the brain using Go, instead of C++. He had grown increasingly frustrated with the long build times and tiresome boilerplate involved in coding in C++. Python is, by itself, too slow for the actual numerical simulation code, so it inevitably serves as a wrapper around the same dreaded C++, resulting in a complex and unpleasant combination of two languages. Go, by contrast, compiles nearly instantly, and runs nearly as fast as C++. The small difference in compute time (less than 5-10%) was more than made up for by the massive increase in coding efficiency and overall happiness from using Go.

Overall, GoKi provided a powerful 2D and 3D interface that enabled experts, as well as novice undergraduate students in various classes taught around the world, to better understand and develop new ideas about how the brain works. However, as a first effort in Go, GoKi retained too much of the C++ style, and many important lessons were learned in getting everything to work.

Meanwhile, Randy's son Kai was busy experimenting with lots of different frameworks and languages for various coding projects, and eventually came to the same conclusion, that Go is truly the best language around. After exploring the various existing GUI frameworks in Go, Kai came to the conclusion that a major overhaul of GoKi might end up producing a much better framework than any of the other options.

So the father and son team (more son than father, to be clear) spent the next year rewriting this codebase many times over, peeling away layers of complexity and finding the most robust and elegant solutions to the many problems such a framework must solve. The [Principles section of the documentation](https://cogentcore.org/core/architecture/principles) captures some of our hard-won lessons learned, and we hope that the experience of using this framework demonstrates the resulting simplicity and power of the approach.
So the father and son team (more son than father, to be clear) spent the next year rewriting this codebase many times over, peeling away layers of complexity and finding the most robust and elegant solutions to the many problems such a framework must solve. The [Principles](https://cogentcore.org/core/architecture/principles) capture some of our hard-won lessons learned, and we hope that the experience of using this framework demonstrates the resulting simplicity and power of the approach.

As a young and ambitious programmer, Kai has many plans for future apps to program in the Cogent Core framework, and Randy continues to develop his neural network models for research and teaching. Throughout the process, Randy has maintained what is now Cogent Code as his primary everyday editor, and the new versions of the neural network models are also well tested. Therefore, we are confident that the core of the framework is solid and ready to use at this point, even as we continue to build out more features and welcome suggestions and input from the broader community for how to make it even better.
As a young and ambitious programmer, Kai has many plans for future apps to program in the Cogent Core framework, and Randy continues to develop his neural network models for research and teaching. Throughout the process, Randy has maintained what is now Cogent Code as his primary everyday code editor, and the new versions of the neural network models are also well tested. Therefore, we are confident that the core of the framework is solid and ready to use at this point, even as we continue to build out more features and welcome suggestions and input from the broader community for how to make it even better.

We are excited to build toward a world-class GUI framework in our beloved Go language, and hope this excitement is sufficiently contagious to grow a vibrant community of users and developers. We think Go is such a special language that it deserves to be used for everything and anything, outside of its traditional role as a server-side and cli-based workhorse.

Expand All @@ -109,11 +110,11 @@ One important future direction, evident in the interactive editing ability shown

Furthermore, we have written a shell language variant of Go, called `cosh` (Cogent Shell), which allows direct intermixing of shell-like execution of command-line tools, with standard Go control constructs, using the yaegi interpreter. Everything can be transpiled into standard Go and built the usual way as a fully compiled executable as well. Next, we plan to extend this general approach to the numerical computing and data science domain, in the Cogent Numbers framework, to provide a viable competitor in this Python-dominated domain.

In addition, we will be completing the Cogent Canvas app, which provides editing of SVG-based vector graphics (and bitmaps embedded therein), and the Cogent Mail client. We also plan to make a video editing app, and even keep plugging away at a web browser!
In addition, we will be completing the Cogent Canvas app, which provides editing of SVG-based vector graphics, and the Cogent Mail client. We also plan to make a video editing app, and even keep plugging away at a web browser!

## Comparisons with other Frameworks

In the remainder of this blog, we provide some commentary about how we think Cogent Core compares with various other widely-used GUI frameworks and languages. As you can tell if you've read this far, we think the Go language is the best, so if you strongly prefer another language, Cogent Core may not be for you. But if you've been slogging along in the Javascript + HTML + CSS world, or come from a Qt / C++ or Flutter background, you might find something to like here.
In the remainder of this blog, we provide some commentary about how we think Cogent Core compares with various other widely-used GUI frameworks and languages. As you can tell if you've read this far, we think the Go language is the best, so if you strongly prefer another language, Cogent Core may not be for you. But if you've been slogging along in the Javascript + HTML + CSS world, or come from a Qt/C++ or Flutter background, you might find something to like here.

### Javascript + HTML + CSS Frameworks

Expand Down

0 comments on commit 41286a7

Please sign in to comment.