TypeScript vs C++ for Graphics Programming | Shader Game Engine Development

preview_player
Показать описание
In this video, we go over why I chose C++ over TypeScript for building a shader game engine.

The first reason is that C++ has better libraries for graphics UI development than TypeScript. ImGui comes with all the tools built into the library, while the JS libraries (like Dat.GUI and Tweakpane) are lacking features. It also used by most game dev companies across the industry so there is strong community support.

The second reason is that state-management is easier with ImGui than it is with React. This is because React re-renders when state changes while ImGui re-renders the entire UI every frame. This makes it easier to handle state changes and does not require the use of component life-cycle hooks and on click handlers.

The third reason is that JavaScript is way too slow. I learned about this when reading how Microsoft improved the performance of the TypeScript compiler by 10x by switching to using GoLang.

The fourth reason is that the graphics community uses C++ as the main language of choice.

== [ Related Videos ] ==

== [ Timestamps ] ==
00:00 Intro
00:20 Shader Demos
01:37 What is a Shader Game Engine?
02:32 Alternative Game Engines
03:44 TypeScript vs C++
04:06 Professional Experience
04:55 External Libraries
06:17 State Management
07:08 Performance
07:54 Graphics Programming Community

== [ Music Credits] ==
Nujabes - Aruarian Dance
Lee - Rain

== [ Tags ] ==
#suboptimal #glsl #shaders #cpp #typescript
Рекомендации по теме
Комментарии
Автор

JavaScript, a language where the ceiling for performance is on the floor.

SuboptimalEng
Автор

I do quite a bit of pondering what language is best (especially in the graphics programming space) - I'm still torn between C and C++, because C++ has a lot of features that help development of graphics - but there is a lot going on in the backround (similar to JS) - C gives you barebones features only, but almost everything is transparent and understandable if you know the language. I'm still leaning towards C++ because of the community aspect though.

etherweb
Автор

The title is so fucking hilarious when you've built a 3d engine from scratch(no OpenGL, just SDL2 and MATH) in C++ and tried rendering 1million+ vertices... You quickly realise, unless you want to make a game engine that plays at .5fps 720p, then you can't build it in TS

Manhwa
Автор

This is like why I switched from barefoot to sport shoes for running.
JS already gets picked on enough leave us alone

ahmdmoadi
Автор

You made the best decision of your life

Manthan_ampersand
Автор

Computer graphics is usually GPU, not CPU bound, so performance wise TS loses only if other aspects of your tool/game require CPU computation. And I would not call JIT compiled languages slow, considering how much easier they are to use.
If I had to leave my TS/WebGL/Solidjs stack because of perf reasons, I would probably go with Zig/GLFW/ImGUI, rather than C++. I have too many complaints to C++ design decisions.

ivanjermakov
Автор

what do you think about portability? I haven't been in the C++ ecosystem for a decade but there was always a problem if you want to ship to mac and wnidows and what about android tablets? or is this not a concern?

jamescat
Автор

seeing saki in coding video is diabolical

ryank.
Автор

First of all, there is a tool called SHADERed to develop shader very easily. And second of all, why C++ where there is Rust? Yeah, there are a lot of libraries in C++ for graphics programming but setting that up is really horrible. Where in Rust, you just `cargo add wgpu`, `cargo add egui`

zxnnightstalker
Автор

Why did you decide to create a Shader game Enginge ? I am just curious what problem you where trying to solve. A lot of the engines you mentioned by other youtubers where made for video style animations.

FumezCreates
Автор

I have the same idea. With AI, c/ c++ has become lot more easier than before. and all you need to do is have great patient and bear with its long variable names

songxu
Автор

For me c++ with web assembly would be a great combo

bause
Автор

the term game engine is quite stretched in this video

xXx-unie
Автор

i welcome you to c++ (im new to it dw)

nocoreal
visit shbcf.ru