Trunk

2021-07-23 17:23

trunk_word

What

Truck is a desktop application that can be used to learn languages through reading comprehension. It is very similar to programs such as LearnWithText and FLTR.

Trunk is a language learning tool based off of Learning with texts. Users can practice their reading comprehension by inputting articles / short texts in their target language, and then moving from word to word and establishing their familiarity (and translation) with that word.

Trunk is built with clojure and electron.

Why

I built Trunk for several reasons. First, I was looking for a programming project to do after taking an extended break from programming. At the time, I was learning French. I was using several tools to practice my French and wanted to build my own. Trunk served useful in this regard. I quickly became re-immersed in using closure. I never ended up using Trunk very thoroughly for practising my French but I still hope to do that.

I felt that some of the existing solutions that were very similar to Trunk presented challenges to people who we're not particularly technical. Learn With Text, for example, required the user to set up a PHP server. FLTR required people to install Java. I wanted to create some thing that was entirely self-contained downloadable open source and useable by non-technical folks.

Retrospective

There were several things that I did "wrong" when building Trunk. I will start with the most obvious. First off, (and this wouldn't be too significant to change), I found a hackey way to integrate the Google translate website into Trunk. Google would prefer if you did not do such things—Google Translate through an iframe is not possible. Nonetheless, I found a way to use the electron API to embed the Google translate website and dynamically feed it words to translate. What's wrong with this? First off, although perhaps not soon, but certainly someday, Google will change how Google Translate looks. When they do this it will, at the very least, break Trunk's layout. I was too excited at the fact that I was able to get around embedding Google translate that I didn't really think about this.

Next up, fiddly-sqlite-drivers. I still don't know exactly what it went wrong, but using certain SQLite libraries with electron can actually be quite a bit of pain. I settled on a lesser known but more powerful and more pleasant to use library (better-sqlite) yet it has all kinds of difficulties with electron. Again, this is something that will be fairly easily remedied.

Last but not least, the use of electron itself. I've used electron for several different projects and I've always enjoyed the fact that I'm making desktop applications that work off-line. In this case it was seemingly quite suitable in that I was interfacing with sequel light and I wanted people to be able to control their data. It all makes sense on paper. The frustrating thing, and again this is merely my problem and not electron's, is that every time I came back to the application there was a new version or some kind of EPI breaking change it required other things to be deconstructed and reconstruct it again.

I really have no qualms with how much resources electron uses, so long as I'm building something that is not for developers and does not have to be extremely fast and responsive. Trunk is a tool for studying a language and it is not something that would be used day in day out for hours at a time. To be honest I thinkTo be honest I think electron is really the best solution I could've chosen. What I would've done differently, however is pick the most popular and least likely to cause breaking changes in the future when it comes to libraries thatthe best solution I could've chosen. What I would've done differently, however is pick the most popular and least likely to cause breaking changes in the future when it comes to libraries that integrate with electron.

The Future

There are series of features that I would still like to create for trunk should I ever return to it.

Anki / Flashcard integration

I would argue that Anki has had the biggest impact on my ability to pick up vocabulary. Being able to replicate or at least integrate with a tool such as Anki using the words a user has collected in trunk would be great.

Ebook integration

Originally, I intended to use Trunk with newspaper articles; it seemed like an easy way to find reading material that wasn't too long. In retrospect, I don't want to read the news. Let alone in another language. I think it would be too hard to integrate with a library that person is e-books (since as far as I know, e-books are just bundles of HTML and CSS) and make it possible to read e-books.

A mobile solution

When I posted trunk publicly for feedback at least one person asked if I could turn it into a mobile application. In retrospect I think that makes sense. But I don't think that I could shoehorn what I built into a mobile application despite the fact that I could continue to use closure mixed with whatever library they use now to wrap up react native. Realistically, I'd rather practice reading a little bit of a new language on my phone when I have a few spare moments rather than find my computer and intentionally open up an application for that purpose. What I'm describing is how I would prefer to be using my phone in moments of downtime rather than the usual soul/energy/attention sucking apps that exist now.