Porting Obsidian to C++ and Legal Issues

Hi,

First of all, I love Obsidian, thanks a lot for the great app!

I’ve recently migrated from Evernote Legacy to Obsidian. Evernote Legacy clients (for desktop, IOS and Android) were quite responsive because they were written using native languages for different platforms and were not electron-based. I understand the reasons for using Electron, but mobile memory footprint and startup times are terrible for such apps. That’s why I pondered to write an Obsidian runtime in C++ and integrate it into native applications. It’s still just an idea.

But now I’m mostly concerned about legal issues - can I do so without any legal implications? Can I license it. e.g. under “Apache License” and open source it?

6 Likes

I am not completely sure I understand what you are trying to do nor why you are concerned about legal issue.

Obsidian is closed-source software with a license. So you can’t port Obsidian.

Of course, you may write your own note-taking app that is compatible with Obsidian’s features in whatever languages you choose.

2 Likes

Your message and the link are pretty much answer my question, thanks.

Just to give a bit more more context - I was thinking to write a POC solution in C++ (an application) as a side project which might be compatible with obsidian vaults AND plugins ecosystem. If it succeeds, I might open source it. Why am I concerned with legal issues? Because before doing so, I want to be sure that time spend on it is not all for nothing due to potential legal complaints from Obsidian itself.

Would it be possible to clarify what exactly “port Obsidian” means to not cross lines that should not be crossed?

1 Like

Porting=modifying the original code to a different platform

Writing something compatible with .md files and obsidian plugins would be completely fine. That’s one of the benefits of the file-over-app principle obsidian is built on, anyone can create a program to act upon those files.

1 Like

I am eagerly looking forward to a C++ version of the Obsidian program. The current performance of Obsidian is quite poor, especially in terms of multi-core usage and canvas handling. However, I understand these issues are due to browser limitations. I wonder if switching to C++ could solve these problems, and whether plugins and CSS snippets would still work properly.

In what way does this occur? I have a quite old and low-performance computer and I’ve been using Obsidian for over two years, I have about 5 thousand notes and 4 thousand attachments of various formats in my vault, but I haven’t noticed anything that hints at low performance of Obsidian - on the contrary, compared to all the other note-taking software I try on a regular basis (Logseq, Affine, Anytype, Appflowy, …) (…not sure about SiYuan…) Obsidian seems quite performant to me. On Canvas I do experience poor performance, but outside of it I don’t.


But regarding C++… as someone who “watches programming from the outside”, I wonder why Obsidian is being developed with Electron.
I’m not sure, but it seems to me that the main reason is cross-platform, which allows to provide the tool to more people without having to bring in more developers to develop it, which allows Obsidian to remain Free Personal and 100% Supported by Users, which is apparently quite important to developers.
But… doesn’t Qt make it possible to create cross-platform software using C++? That, if anything, is really the question.

If it does, then the main reason for choosing Electron is not cross-platform, but the skills that developers have?

I might be a heavy-duty user. I currently use four 4K monitors to edit in Obsidian because I need to read and organize a large number of books and papers. Typically, I have four windows open, two of which are split, so I end up editing six files simultaneously. Among these files, one or two are canvas files used to organize various notes.

My notes are primarily composed of H1, H2 headers, and lists, with a large number of block references, similar to ![[]], to reference specific list items. This setup puts a significant strain on performance. Through extensive testing, I’ve found that the main issue is that Obsidian can only utilize a single CPU core.

If you’re interested, you can check out some of my previous posts on the topic. I shared a link before, but the moderators may have thought I was over-referencing my own posts, so it wasn’t allowed.

I have also conducted extensive testing, investing a lot of effort and time (all of which can be found in my past posts, which were published under a different account). I discovered that even the best CPUs currently manufactured by humans cannot provide sufficient single-core performance to ensure smooth operation of Obsidian (in my environment) or within the canvas environment — especially when the referenced notes contain more than 20,000 words and multiple references are present.

PS:I really wanted to quote the detailed post, but due to receiving an official warning like this:

“Hi Sam12, please don’t cross-post and campaign your thread. I flagged it as off-topic.
Thanks”

I can only say you can search for “Proposal for Multi-Core Processing to Boost Obsidian’s Efficiency.”

2 Likes

Well… it’s honestly hard for me to imagine a situation where I would have the need to use 4 monitors and 6 Obsidian windows. In my experience, I’ve only realized that the main limiter is not the hardware and software used - but my own brain. And a system really works when it is as simple as possible, because as soon as a system becomes too complex, the brain needs to devote more cognitive resources to interacting with it, and more time to maintaining it and keeping it in proper condition, which all together just leads to the fact that instead of doing one’s own activity, one starts doing maintenance of one’s own system, which does not allow one to achieve the goal for which one originally wanted to and:

As for Obsidian, in my case I work with only one file at a time, occasionally I have to work with two or more files at the same time. I always try to get rid of any multitasking and complexity, and if it starts to be present in my process, I consider my approach wrong and try to simplify it. My whole system is also quite simple, and I try not to complicate it unnecessarily.

And neither 10 monitors nor multi-core processors will change the structure of your brain, make its abilities better, or make the wrong approach the right one.
People have achieved very impressive results with a pen and paper, so is modern hardware and modern software necessary, or does it just distract from what’s really important?

For me, a working system is a system that is minimalistic and as simple as possible in its implementation. A working approach is as simple as possible without any multitasking and unnecessary complexity.
The more information and tasks there are, the harder it is to focus on one thing and devote all resources to that one thing.
Complexity of the system does not ensure its effectiveness.

However, I do not consider what I have written to be the absolute truth, and I accept that the opposite can also work.

I hope you can find the right tool for you, because dissatisfaction with the software you use, including Obsidian, is quite close to me, and I understand what it is like when instead of something “just working” - it puts a stick in the wheel at every step, and does not allow you to realize what you want to realize.

I read your post “Proposal for Multi-Core Processing to Boost Obsidian’s Efficiency” in part before this thread, but it’s hard for me to say anything about it, as I have little interest in the subject and am not technically savvy enough to say anything meaningful.

3 Likes

Qt is basically used to develop softwares for embedded system, for example the ones which you see on your expensive cars dashboards. They are built using C__ is because, this language is very powerful in terms of processing graphics, so you get a high control of each and every pixel and that inturn help you to render or update those pixels very fast. As you climb up this graphics processing tree, you get the applications which are very responsive and without any lag. And that’s why C++ is used in such mission-critical areas, because your dashboard should update very fast and with high accuracy.

And don’t get me wrong, using Qt you can develop desktop applications and not only with Qt there are few other frameworks as well to develop desktop applications. But you will usually notice that, these are again applications for some high processing operations or usually games.

Now, coming to developing an application like Obsidian using C++. As a quite an experience developer of C++, specifically in graphics processing, I dont think you will be able to achieve the level/state Obsidian is right now or won’t able to build a community like this one. The reason why this is so active community is because, any user can open the developer tool window and do whatever kind of UI customization they wont and even UX wise as well using the js scripts. So, even if say you are able to reach the state at which Obsidian right now (without any community plugins, ofcorse), its users wont have that much customizability power.

Alright, we are imagining, so lets also imagine that while developing the software, you also able to create some kind of architecture where, people can create plugins using C++ (which will be libraries) or use the JS bundled plugins itself, you will eventually end up with making some kind of interpreter layer to interact with those plugins. And guess what, JS is basically scripts which is translated to machine code using an interpreter which is developed using C++, I guess so. So, the conclusion here is, there is not a big enough community of C++ in this specific area, for bundling some sort of plugins and attaching them to the main application. (I had came across such kind of project a long back, dont remember it now)

But I can guarantee you that, using the libraries in C++, such as CUDA or other graphics library, you will get the best performance what @Sam12 has requested in the various posts. The graphs and performance for rendering the multiple notes as once and also doing the disk operations will be much faster. But again, what will you do with just that many functionalities, you might feel the need to have additional features which is provided by Obsidian through its plugins and the functionality to customize using scripts and style templates.

The reason for writing such a long post, is because, I had thought about it few months back. And if I personally think, its not worth to start the development in terms of creating an exact replica of Obsidian. Because it will take a huge amount of time, after all its C++. But this can be an amazing project for college students, since they will have a lot of time and it will really make your programming concepts strong, as you will get to learn, multiprocessing, graphic processing, etc.

Suggestion : If anyone wants to take it as a project, I would personally recomment, instead of making an application which is just to work with MD files. Develop a framework, wherein:

  • If you create a desktop applications, user can customize the UI using mostly CSS language (but C++ do not use CSS to style their applications).
  • (Much better idea) It’s possible to create some sort of plugins, this may not be C++ libraries, it can be executables as well. But then each plugin developer will need to make different executables for different OS platforms, so the plugin bundles should be such that, you just put them in the config folder and your application will be able to detect them and load them in the main application.
  • Resources for building such an architecture, you can refer to how Notepad++ has been build their system for other people to create plugins and integrate into it and similarly create your own system. Please do not create the application by making fork of Notepad++, its for some reason has become very laggy and buggy. Try to start from scratch for bulding desktop application, refer the Notepad++ project ,only to know how they have implemented the functionality of connecting plugins to main application.

If you are able to create such a thing, then your community might grow faster, depending on how many C++ developers out there, and then creating the main application to work with MD files will be like a cakewalk.

2 Likes

Many problems cannot be simply categorized or classified. A single concrete problem inevitably projects onto multiple abstract categories. If we consider entities a, b, and c as concrete problems, and A, B, C, and D as abstract categories, the correlations between them are already sufficiently complex. Moreover, each time we reexamine these issues, new subcategories, such as A1, A2, and A3, emerge within the abstract classifications.

What’s more, real-world problems are far from being limited to just three concrete problems and four categories. Every time I develop an idea, it inevitably connects with other content, drawing on the conclusions of other analyses. This process aims to avoid repetitive references and branching thoughts (or re-descriptions).

Especially for creative theoretical research, the process involves numerous formulas, practical examples, personal reflections, conclusions from others, synthesis, discussion, and refinement. All of these factors make the note-taking system extremely complex. You might find yourself discussing the same issue across two different Markdown (MD) files.

Even if you abstract these discussions into an independent document, the growth of new ideas often requires working within the context of a specific problem’s MD file. This inevitably leads to constant note reorganization. Simply copying content to a new document creates a void in the original context. At the same time, it’s impractical to sacrifice thinking and recording inspiration just to maintain a structured system. Capturing inspiration quickly and recording it in the moment is absolutely essential.

Therefore, for me, multi-screen support, Canvas performance, and multi-core processing are all crucial. I need to work with multiple documents simultaneously, rather than following a one-dimensional linear accumulation of analysis. To be honest, even four screens aren’t enough for me right now, and I’m considering adding a fifth screen.

For me, Obsidian is a tool to quickly project all my thoughts and ideas from my mind, as well as a platform for processing them. I have an intense pursuit of its performance, as severe lag significantly affects my ability to capture and refine inspiration. If someone were willing to rewrite and develop a similar tool in C++ to overcome its single-core limitation, it would make me happier than winning a multi-million lottery.

1 Like

Yes, one example of that is me with the ADHD I have. My brain works faster when I make huge amount of mess on my table, multiple books opened everywhere. This is usually during some kind of research or in process or finding a better solution. And also with desktop, I always prefer as many monitors as possible. So i guess @Sam12 and I are in same boat.

I have liked the earlier posts of sam12, and I am too interested in the same as well. I am new to JS, so what I would like to do right now, is first try to find out whether JS supporst this functionality to make use of multiple cores of CPU to do the particular task faster, If its possible, discuss with the Obsidian team, how easier it is to make Obsidian codebase to make use of it. Finally we will have to just wait for the future version of Obsidian.

But I would also like to mention that, I cant be certain, whether the low performance of Obsidian interms of handling huge amount of processing with multiple windows and graph view is specifically related to single core usage. Obsidian is closed source and I dont know how JS works at low level, so Obsidian might have been written very efficient code and JS is the bottleneck here. Or JS is already using some sort of multi-processing thing at low-level, but its the Obsidian’s, code which has to be improved to make the best use of what JS provides. So it can be any reason and not specifically related to whether using C++ or JS for building the application will give a good performance. There might be a case, where you have created an application using C++, but with poor garbage collector knowledge, you end up making a poor performance application. So, C++ proper knowledge is also very vital.

1 Like

Thank you very much for your valuable response. It has helped me understand many aspects and the difficulties of development. For us laypeople, the lack of concepts might make us simply think that it’s like cutting a cake into more pieces and putting them in the fridge, without considering the constraints formed by the internal structure. :smiling_face: :smiling_face:

Additionally, I am really grateful to have met an enthusiast like you (I thought I was the only one feeling lonely in this situation, but I believe that as everyone accumulates their notes, they will eventually face the same problem as I did). I was originally very desperate about this matter (on one hand, it seemed like I was the only one, and on the other hand, the ultimate solution seemed to be only in the improvement of single-core CPU performance, but now it seems that we have reached the physical limits and there won’t be much improvement). You have given me a lot of hope (please don’t feel pressured, I just suddenly feel less lonely)

1 Like

Omitting the fact that I’m not currently a developer, and at the very least that’s why I won’t be able to do this… why not?

The goal is to create software, not a community

Lately, I’ve found it increasingly impossible to do so: Ability To Prevent DOM Element Removal In Active Note, Nav Tree, etc

In 2D and 3D graphics software, which, as far as I know, are mostly written in C++ and Python, scripts and plugins are not so rare, but rather even… commonplace?
I’m talking about 2D and 3D graphics software because this is my main area of activity and I’m more familiar with it than anything else.

I don’t mean to sound ignorant to other people’s work, but I believe that in all the time Obsidian has been around, among its two thousand plugins, the only two really worthy plugins are Excalidraw and Dataview, with the former being basically a separate software that wasn’t originally developed as a plugin for Obsidian, so it can hardly be considered a plugin.
So… is there such a need for a large community, or are the developers themselves quite enough?

I still don’t understand why so much software is developed using Electron…

1 Like

Pleasure is all mine!

Actually, while reading your above post, I was also getting few ideas on how can I improve my current workflow to manage my workload while researching or building stuff.

Well, I believe before starting anything, the most important thing is to setup the foundation. Once the foundation is all in place and powerful, we can build anything on top of it.

And from a while now, Obsidian has been that foundation to quite a extent. Hence, with some programming knowledge, I decided to develop my own plugin (Task Board) to give a boost to this foundation. But, the current workflow I am trying to setup right now, will be a little different from yours. I am able to image (not fully) what your workflow might be looking like with what you have explained in your various posts. Mine is a little different from that, because at present I am not making use of Graph plugin or excalidraw that much, but I feel, I might be required to use it a lot in future.

My workflow, looks like this : Sometimes I work on three different things, say A, B and C. Then, say while working on A, I felt a need that, I have to find a better solution before proceeding further with this development/research. So, I start researching/developing the better solution, this creates a branch : A-1. And while this A-1 is in process, I also move ahead with the main branch ‘A’.
While, all this is going on, same thing is also happening with the other two tasks B and C. And this might also have their own branches B-1, B-2, C-1, etc. And although these A, B and C are different tasks/research/development, sometimes I also find a links between A anc C. So, then I have to link them and may be, create a new branch and it goes on…

So, while I am working on one thing, say A, and I am required to create this new branch A-1, my main workflow with the ‘A’ branch should not stop. And I also have to keep recording my progress on A-1.

This is basically the foundation I want to build using this new plugin.

Okay, Ill try to answer the best I can for the rest of your question, may be some other time.

But for this specific question, in your most questions, you are ignoring the importance of community. And by community I am not just referring to people who are using it, people who are contributing in terms of sharing their creativity and advertising the application more and more and the people who are developing the plugins. I am also referring to people who are actively working on improving the main application stronger.

Electron has a very big, supportive and easy-to-connect (I am not getting the word here) kind of developers community. So, eventually the support for this framework has grown large over the years and also it’s been backed by billion-dollar companies(not sure). Hence its more easier for people to create applications using it rather than using a framework, which is very difficult to understand, might not be suitable for faster reach and also will be difficult to expand with the limited knowledge.

Simplest way to understand : “If you want to reach fast, walk alone. But if you want to reach far, walk together”. In software development there is no final destination, there is always a room for improvement. So we have to build the framework stronger to reach the farthest.

2 Likes

This is indeed true, and I can’t understand why you, and probably other people, place such importance on it. When I do my work, it is important for me to do it well on my own, rather than hoping that it will only become good after other people have contributed to it. And this is the direction I think is right - to work on myself, and to count on myself, not on other people.

And… does C++ have such a bad community? Krita and Blender don’t seem to live so badly and are developed by the community as well.
Although to me the realm of 2D and 3D graphics seems more distant from programming than note-taking software, which as far as I understand is basically a text editor.
So it seems to me that there is quite enough of an community to contribute to note-taking software written in C++, and this is not at all a problem relative to Electron.

Forgive me for my idealization and perfectionism, but when it comes to serious work:

  • Is the goal to make it “easier”, or to be high quality and do the job as well as possible?
  • If something is hard to understand, it just means that when you try to understand it, it will be hard for you, but it doesn’t mean that you can neglect it and look for some “workarounds”
  • English is not my primary language, so I don’t really understand the meaning of the phrase “faster reach” - but again, is the goal to “faster reach”, or to create a quality tool that will perform its function well?
  • If something is difficult to extend with limited knowledge, then, again, that means expanding your own knowledge first, rather than looking for “workarounds”

I realize that in a real world context this approach would probably just fail total failure, but I just can’t accept the opposite of it.
And with this sentence you also explained to me why developers have the choice falls on Electron, thank you - it’s the difference between Electron and C++ that I wasn’t aware of.

I don’t understand why.

In case if no one else has told you about this, then I would like to mention that, I would be the first person to appreciate such a project/application and would love to collaborate and contribute on the same.

Loading the same plugins which are written for Obsidian and loading the vault (this will be easy, I am just talking about editing the MD files in WYSIWYG editor, forgetting rest of the features for now) will be a really amazing thing to have and to develop.

Looking forward to seeing this in action.

Just in case, I’ll mention that there is already one note-taking software written in C++: GitHub - nuttyartist/notes: Fast and beautiful note-taking app written in C++. Write down your thoughts..

Ahh, thanks for sharing this, I came across this a long back before Obsidian, but never went forward to explore more. I guess ill try to see what its capable of now in terms of expanding it further. That is if its possible to support multiple windows and Graph view and if possible, integrate Excalidraw directly or create something like that in built, which will be difficult. But there is already Draw.io similar to Excalidraw as well.

But, coming to this project, I went back to when this project was started, and it dates back to 2015, almost going to complete 10 years now. That proves my few points above that: there are not many C++ developers, second it takes a lot of skills and time. After putting all this hardwork, you dont get an impressive application like Obsidian, which is highly customizable. And this notes application also dont support plugins, so not that expandable.

Another thing which I personally feel, (I dont know how much of its true) people trust proprietary softwares more than open-source softwares, if they are not backed by bigger companies. Example, VS Code is open-source but is backed by Microsoft.

So, its always comes to the community, where every single individual when contributes something or other, it helps the overall software to grow faster.

The reason why I got attracted to Obsidian was after learning Zettelkasten system and the USP of Obsidian that is, everything is stored on your system locally using MD files, which is what I always look for. But the bigger reason for sticking to it instead of moving to other softwares, which I always do, was the customizability power it provides in terms of themes and plugins.

1 Like

Both are backed by a good number of big sponsors and also these software are being around from a long time, Krita project was started initially by GNU softwares, somewhere back in 90s, I think. Compared to the Notes software, which you just shared, which is completely open-source, that is no one is sponsoring them to integrate, say, Graph view feature into it.

I actually used to think the same, I dont know how many have been doing this, or might not believe me. Earlier I use to take my notes in .txt files and was using Notepad++ software. Because I wanted something, light, fast and which is always there on my system opened without taking much of RAM, since I had a very old PC. But as the technology advances and the availability of tools like excalidraw has become so easy, it often becomes a habit to use this 2D softwares to visualize and take hand drawn notes.

  • Here I was referring to the ease of using the framework. Since a lot of developers can easily adopt Web technologies compared to Java or C++ and hence are able to build lot of things using those technologies faster. This was the reason actually, why PWA and eventually Electron became so popular, because so many people are using it, the bigger is the community.
  • Unfortunately, C++ (with its steep learning curve) is often hard for many developers to adapt at first go. Hence most of them go for easier solutions/framework. I believe, developers are artists, they want to put their art from mind to computer as fast as possible. So to bring this ideas into reality they often try to choose the fastest way they can able to achieve it. And once its achieved, then sometimes, they about, how this can be further optimized. (I have seen companies moving from node.js to Golang for their backend)
  • English is not my first language either. But what I meant by “faster reach” is growing users of a particular software and expanding its popularity. More the demand for a software, the higher will be the sponsors and profit to keep the support and development of the software alive.
  • My second point explains this. I have usually not seen young people very good at C++. Only after years of experience you get good at it.

I understand your way of thinking for using a better framework to begin with to build very high performance softwares. I actually share the same mentality or may be use to have the same thought process. C++ was my first language, and it will be my favorite language always. The most influential person for me to love C++ even more is The Cherno. And whenever I see any software, the thought always comes to my mind, that won’t this software be possible to build with C++.

But, over the years I realized that, sometimes it’s just fine to go with the framework :

  • In which you feel comfortable.
  • The community for that framework is very active (for example if you want to develop a game, you should go for choosing a framework in C++ and not python, because there is better community for you to help in C++ for the specific game dev arena),
  • The language/framework will be able to handle the processing you want to do. (In recent years, I have seen JS has done some great job in creating libraries like Three.js, etc, which are very good at doing 3D calculations.). So, I think language may not be the bottleneck to achieve the performance we want, as the hardwares are becoming more powerful and as the community of JS grows stronger, we might be able to see a very high performing things done in JS.
1 Like