Recent comments in /f/coolgithubprojects
Elyahu41 t1_j7c21jd wrote
Aww, only linux?!
code_architect t1_j7c1kwk wrote
If you have to use the mouse to click buttons with hover effects, is it really still the terminal? Might as well just be a GUI at that point. I guess there a corner case of wanting to run this on a server you only have headless access to. Still quite impressive for what it is though.
That cat
command is neat, does it play nicely with pipes?
ThenChoice2 OP t1_j7aoqtj wrote
Here is the repo: https://github.com/PabloLec/RecoverPy
I recently released version 2.0.0 with a whole TUI framework shift, any comment is welcome :)
TheLogicMaster OP t1_j5ddrfk wrote
Reply to comment by shai_almog in Clearwing VM: A Java to C++ transpiler by TheLogicMaster
Thanks. Yeah, this is really my first time posting about the project since it's in a working state, and I wasn't aware of that sub, I mostly perused the source code.
That's always fun. I've considered doing something with LLVM, but I opted instead to make something that's a bit more unique in some of the design choices, prioritizing that over pure performance.
[deleted] t1_j5dc9ol wrote
Reply to comment by shai_almog in Clearwing VM: A Java to C++ transpiler by TheLogicMaster
[removed]
shai_almog t1_j5dc8n4 wrote
Reply to comment by TheLogicMaster in Clearwing VM: A Java to C++ transpiler by TheLogicMaster
Interesting. Good luck with the project and keep us posted. I'm surprised you didn't post about it to /r/cn1 which admittedly isn't a huge sub. But its nice to see new projects.
I'm also considering writing a new AoT VM. More for the backend than mobile. I have some ideas that I need to explore in that direction but I'm pretty busy with other tasks at the moment.
TheLogicMaster OP t1_j5dbkl9 wrote
Reply to comment by shai_almog in Clearwing VM: A Java to C++ transpiler by TheLogicMaster
Yep, Java constructors and finalizers have to be treated as normal methods completely separate from C++ constructors and destructors, which is reasonable, anyway, with how Java objects are normally constructed. Trying to merge the Java and C++ constructors would definitely present issues, and destructors would be worse. Virtual inheritance is definitely a pain, requiring a number of workarounds to get everything compiling, plus sketchy behavior like needing a shared pointer to the object that's been partially destructed while calling the finalizer, or calling the finalizer to begin with, since the virtual function table changes during destruction. Everything has been working quite reliably so far, though, not running into any issues with the thousands of generated classes that I've tested.
Yeah, it's primarily the issue of debugging it. I've considered what would be required to implement one here, and it wouldn't be too bad to implement a similar one, but I've just spent so long debugging GC bugs in the C version, I opted for peace of mind and the performance hit, knowing that it may have been a decision I would regret later. It basically resolved all of the memory bugs, though, and the performance is still sufficient for now, so I'm quite happy with it. It's also nice not having to worry accidental collection in native code, though that could be mitigated with convenient C++ features.
shai_almog t1_j5d91cq wrote
Reply to comment by TheLogicMaster in Clearwing VM: A Java to C++ transpiler by TheLogicMaster
There are some nuances in the Java object model such as constructor order, object initialization, etc. that are very fine and might collide with C++. That's my main concern here. Also virtual inheritance is a pain. Anyway, I hope that works for you.
Curious though why you didn't port the GC?
I get that it's hard to debug but it's kind of an important part of the puzzle. It isn't very complicated either.
TheLogicMaster OP t1_j5d8fm6 wrote
Reply to comment by shai_almog in Clearwing VM: A Java to C++ transpiler by TheLogicMaster
Yeah, C++ seemed like an interesting challenge due to the object hierarchy issues, but I think most of the issues have been resolved with just using virtual inheritance. The additional flexibility with C++ makes a lot of the solutions much more elegant, which has been nice to actually work with. Most of the handwritten C++ for intrinsic functions looks quite similar to their Java counterparts, for instance. The whole concept was a bit on the impractical side, since there's no GC, so performance is a bit limited, but it's sufficient for simple games, and completely removes the need for additional countless hours debugging GC bugs.
UWP was more of an afterthought here, since it could be achieved with slight modifications to the C++ codebase while hopefully maintaining identical behavior to the other platforms. The main goal was Xbox support with UWP, since it's for a game framework, but the future of UWP on Xbox seems uncertain, so it was just another feature to throw in for fun. The primary goal of the project was always the Nintendo Switch backend, though there are plenty of other interesting possibilities like wasm.
shai_almog t1_j5d5ybq wrote
Reply to Clearwing VM: A Java to C++ transpiler by TheLogicMaster
Interesting. We specifically chose C and not C++ for ParparVM because of the inherent incompatibility between the object models. I see you're running into some of those problems right now.
Why aren't you using our UWP work based on iKVM?
TheLogicMaster OP t1_j5cnt7c wrote
Reply to Clearwing VM: A Java to C++ transpiler by TheLogicMaster
This is a project created to bring Java codebases to platforms without a JVM using plain C++. It primarily exists to support the LibGDX game framework backend for Xbox and Nintendo Switch, SwitchGDX, though the generated C++ could be used in any environment. It was originally just a modified fork of the Parpar VM to compile with plain C and support further runtime library features like file I/O, but has been completely rewritten as far as the transpiler and native code is concerned to make use of modern C++ features and provide memory safety.
EvitanRelta OP t1_j463a01 wrote
Reply to comment by seanpuppy in HTML-to-Markdown converter that adaptively preserve HTML when needed (eg. when center-aligning, or resizing images) by EvitanRelta
sflr!
Then i guess my converter library has that edge over Pandoc. Specifically, this library can preserve the HTML better than pandoc
So, what im getting is that:
- u want to make a tasklist app
- that stores the notes in markdown
- with an commandline function that inserts a string as a list item under a specific header
sounds like it can be done by just using a bash script to parse the markdown file, find the headers, and just insert the listitem.
for the nested AST idea, im not sure what itd be useful for.
EvitanRelta OP t1_j461czu wrote
Reply to comment by djsnipa1 in HTML-to-Markdown converter that adaptively preserve HTML when needed (eg. when center-aligning, or resizing images) by EvitanRelta
Ayyy thanks! :D
also, sflr! Do drop the repo an issue or a pull request!
causa-sui t1_j3hoz0e wrote
Reply to comment by djsnipa1 in stefins/wdcrypt: ๐A CLI to encrypt all the files and folder in your current working directory. by Adventurous-Inside36
man tar
has several
Adventurous-Inside36 OP t1_j3ffrq2 wrote
Reply to comment by djsnipa1 in stefins/wdcrypt: ๐A CLI to encrypt all the files and folder in your current working directory. by Adventurous-Inside36
I will soon add binaries in Github Releases
Edit: You can download binaries from Release tab
Adventurous-Inside36 OP t1_j3ffmso wrote
Reply to comment by causa-sui in stefins/wdcrypt: ๐A CLI to encrypt all the files and folder in your current working directory. by Adventurous-Inside36
The problem that I found with pipelining is that it doesnโt support multithreading and essentially the bottleneck can be the single tar file which is piped into gpg
.
djsnipa1 t1_j3f5m1b wrote
Reply to comment by causa-sui in stefins/wdcrypt: ๐A CLI to encrypt all the files and folder in your current working directory. by Adventurous-Inside36
Yeah, thanks for the response. Is there a good place that has a lot of useful one-liners?
asdf49 t1_j3f2mx4 wrote
Reply to comment by causa-sui in stefins/wdcrypt: ๐A CLI to encrypt all the files and folder in your current working directory. by Adventurous-Inside36
I was going to say...this can be accomplished in any shell environment with a couple of lines and an executable that encrypts data.
causa-sui t1_j3enkaq wrote
Reply to comment by djsnipa1 in stefins/wdcrypt: ๐A CLI to encrypt all the files and folder in your current working directory. by Adventurous-Inside36
Learn the tools and how to work with pipelines in the shell. Read the manpages etc. Unix philosophy is that everything does one thing but can be easily linked through pipelines. Then you can combine tools to do arbitrary things like this, rather than memorizing incantations.
djsnipa1 t1_j3dyrgn wrote
Reply to comment by EvitanRelta in HTML-to-Markdown converter that adaptively preserve HTML when needed (eg. when center-aligning, or resizing images) by EvitanRelta
This looks nice so far!
Iโve been wanting to input a url and get readability like output in markdown (where it okay keeps the main article and not all the nav and header and footer, etc. I havenโt found one I like so if I end up building my own, Iโd like to try to implement this with it.
djsnipa1 t1_j3dx0q4 wrote
Reply to comment by causa-sui in stefins/wdcrypt: ๐A CLI to encrypt all the files and folder in your current working directory. by Adventurous-Inside36
I wish I knew where to get super useful commands like this! Thanks
djsnipa1 t1_j3dwvch wrote
Reply to stefins/wdcrypt: ๐A CLI to encrypt all the files and folder in your current working directory. by Adventurous-Inside36
Can this easily be built to a x86 Linux binary? So I donโt have to have cargo installed?
causa-sui t1_j3d9bbp wrote
Reply to stefins/wdcrypt: ๐A CLI to encrypt all the files and folder in your current working directory. by Adventurous-Inside36
tar cf - . | gpg --symmetric -o files.tar.gpg
seanpuppy t1_j3aeh8f wrote
Reply to comment by EvitanRelta in HTML-to-Markdown converter that adaptively preserve HTML when needed (eg. when center-aligning, or resizing images) by EvitanRelta
It most likely can't convert the html tag to stay as html. an <h1/> tag literally is a header with one # in markdown. Markdown was meant to be a more human read/write able form of HTML, where its meant to directly translate to HTML.
​
For "inserting markdown" I wish I had a better example ready, I haven't open-sourced this thing yet (or finished it) but it started as an idea to make using my existing note system more powerful / easy to use without actually opening a file.
All my notes from day to day are in markdown, and lets say I use a template with something like below, so that I have a dedicated note file for every single day. (I use a cool VS code extension called Dendron which is similar to Obsidian for markdown notes)
# TODO
* cure cancer
* take a nap
# Ideas
* turn water to wine
# Meetings
## Meeting 1
blah blah
## Meeting 2...
blah
I want to be able to quickly jot down an idea or todo item, but I don't want to have to actual do the mental context switch of switching windows and finding the daily file. My work computer is a mac laptop, and ive found Alfred to be a very powerful and flexible tool to do basically anything from any context.
​
So ideally I could have an Alfred command for "ideas" or "todos" etc... that would insert a string of text into my daily notes into the right spot. So in this case something like `inst $todo email joe about that thing` would insert "email joe about that thing" into a list block under a header tag called 'todo'
​
with an output like:
TODO
- cure cancer
- take a nap
- email joe about that thing
Ideas
- turn water to wine
​
But that got me thinking, there's potential for a powerful / flexible system of converting markdown into a tree like AST syntax that would let me reference different levels of the note similar to how one could reference nester JSON.
​
So I started exploring pandoc, which converts all sorts of things into an AST (Abstract syntax tree) which is almost what I want, except its flat. No hierarchy except bulleted lists. To me, a <h2> below an <h1> is a second level in - BUT pandoc would treat it as a flat list of different markdown elements.
​
I started out trying to write a python pandoc filter (see https://pandoc.org/filters.html ) but realized its intended design couldn't do what I want, but that doesn't really matter as pandoc can handle reading/writing from/to a pandoc AST, so any python script that reads in and spits out a compatible tree will work fine.
SO I created a python script that can handle SOME Markdown aspects, turn it into a nested tree, and spit back out a flat tree, which can then be used as ran through pandoc again to get markdown back out. Once I have that tree, I can start to design a syntax for specifying a part of the tree, and text I want to add, resulting in a modified nested tree, which can still be ultimately converted back to markdown.
​
Unfortunately I haven't opened sourced it yet, I haven't finished but realistically its got enough functionality to be worth sharing as WIP. I hope all this made sense, I'm not sure if I've explained this project to anyone in this much detail yet.
NihilistDandy t1_j7dloyd wrote
Reply to comment by code_architect in RecoverPy: Recover deleted or overwritten files from your terminal by ThenChoice2
It looks like bat, which is indeed pipe-friendly.