Recent

Author Topic: Peach: Homebrew your own Duolingo  (Read 16646 times)

Spoonhorse

  • Full Member
  • ***
  • Posts: 123
Peach: Homebrew your own Duolingo
« on: December 07, 2021, 06:32:19 pm »
First of all, thanks to everyone who's helped me, if you're wondering what I've been up to, this is it, now available for trying out.

It's a program that lets people put together a fully-featured language teaching system to teach any language in any language. (Except the ones that are written top-to-bottom, I haven't done those yet.)

This may not be a big deal if you speak one common language and want to learn another, where there are already plenty of resources out there, but for learning or teaching in small under-served languages this could be really useful. It's software that attempts to fill all the vacant niches at once. It is completely free, for this and other reasons.

By fully-featured, I mean that it can ask written or spoken questions, it can accept written or multiple-choice answers, it can test you on individual vocabulary items, on accidence, or it can put together the vocabulary it knows to produce grammatical sentences for you to translate. It can of course use any script 'cos of Unicode, and the keyboard can be set to produce Fancy Foreign Letters. It is capable of full internationalization. It connects to the Internet so that students can join online classes, they can then download assignments and do them and the results are uploaded to the teacher's gradebook. Though I say it myself, it is pretty good.

That's what the end-users get. Mid-level users, either teachers or motivated students, can make their own vocabulary lists, quizzes, exams, textbooks, etc. And the highest-level users can write the plugins that lets the thing do the grammar.

Here's a demonstration of the sort of thing an end-user might get.

https://github.com/peachpit-site/downloads/releases/download/Win64-Turgan/Turgan.101.setup.exe

(It teaches a made-up language (Turgan) because the conlang community are the ideal people to test the high-level features. I knocked this up for what they call a "speedlang competition" to show how much of an interactive textbook I could throw together over a couple of admittedly very busy weekends.)

And here's a version for high-level users, where you can edit everything. It teaches you how to use itself and includes demos.

https://github.com/peachpit-site/downloads/releases/download/Win64-Peach/Peach.setup.exe

I'd appreciate feedback. The high-level version is set to update (having gained your permission) from the internet, so I can release changes immediately.

Shortly it will be open-source, there's still some gnarly stuff I want to refactor. (This will be the Fifth Great Refactoring, I've been quite good about cleaning my code base. But not good enough.)

When it's open-source, I would like to ask for some help. As you can see, the executables are Windows only. If anyone could help me do versions for other platforms, I would be very grateful. I know FPC/Lazarus is very good like that, that's one reason I'm using it, but the system has so many moving parts that it's not going to be simply a matter of cross-compiling and releasing and it's all going to work straight out of the box. I hope some of you can see how useful this thing could be, and how free and benevolent it is, and would like to pitch in.

I've set up a subreddit https://www.reddit.com/r/peach4languages/ in the hope that as there are more interested parties they can gather there, and if some of you would like to post there and kick things off that would be nice.

Thanks! And enjoy!

Spoonhorse

  • Full Member
  • ***
  • Posts: 123
Re: Peach: Homebrew your own Duolingo
« Reply #1 on: December 08, 2021, 08:34:23 am »
Seems to be going over well with the conlangers. One of them tried it in Linux using WinE and reports that it works, so that's nice.

Spoonhorse

  • Full Member
  • ***
  • Posts: 123
Re: Peach: Homebrew your own Duolingo
« Reply #2 on: December 09, 2021, 04:06:24 pm »
I'm getting great responses from the conlang people. They love it, they're using it, they're writing grammar plugins (including one guy for whom this is his first experience coding) and they're saying really nice things about it. They've turned up a couple of minor bugs, one of which is quite mysterious and only affects a small number of people. But it's also a really tiny issue.

The biggest complaint is that there's no Mac version, so I guess I'll buy a Mac this weekend and see what I can do.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Peach: Homebrew your own Duolingo
« Reply #3 on: December 09, 2021, 04:19:03 pm »
Impressive, well done.

I'm still chuckling over somebody's description of Loglan as "Esperanto for the criminally insane" :-)

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Chronos

  • Full Member
  • ***
  • Posts: 240
    • PascalClassLibrary
Re: Peach: Homebrew your own Duolingo
« Reply #4 on: December 09, 2021, 06:14:42 pm »
The comments are enthusiastic indeed :) https://www.reddit.com/r/conlangs/comments/rb5xbm/peach_homebrew_your_own_duolingo/

It is good idea to create an application similar to Duolingo but without those annoying ads and with ability to add a new custom language. To create custom lessons and stories including speech. That would also require kind of online "store" where those user languages could be updated and downloaded by other users. I use Duolingo daily and I would say that it is pretty nice application and it is also kind of game so it has some addictive properties.

I can help to port your application to Linux and also release it into snap store and other Linux packaging formats.
Also I tried your application and it doesn't support high DPI. You should activate that feature in project settings and test how it looks on high DPI screens (125, 150 and 200%).

Spoonhorse

  • Full Member
  • ***
  • Posts: 123
Re: Peach: Homebrew your own Duolingo
« Reply #5 on: December 10, 2021, 08:49:39 pm »
Chronos, thank you! I'll try and get the source onto Github maybe ... Tuesday? (My weekend runs Sunday to Tuesday.) But really before we try to port it I should add ESpeak NG as a speech engine. At the moment it only uses Balabolka, which is Windows-only.

The Classroom menu already provides some internet functionality. You can always create an account as a teacher, upload stuff as assignments, and have no interaction with your "students" except that they're allowed to download stuff ...

Beyond that, I'll have to see what my users want as things develop.

I can't test how it looks on high DPI screens. I don't have any. I'm a guy sitting in his bedroom with a second-hand laptop and a hobby that got way out of hand.

Spoonhorse

  • Full Member
  • ***
  • Posts: 123
Open source
« Reply #6 on: December 15, 2021, 07:48:24 pm »
Here we are.

https://github.com/peachpit-site/source

I wasn't able to find out how to get GitHub to respect the directory structure short of zipping it up like that. I'm aware that this takes away a lot of the point of GitHub. I'll see what I can find out.

Really ever since about Week 2 everything in this project has been me doing stuff for the first time. Have mercy on me and the bad parts of my code.

Spoonhorse

  • Full Member
  • ***
  • Posts: 123
Re: Peach: Homebrew your own Duolingo
« Reply #7 on: December 16, 2021, 05:36:56 pm »
OK, so I've got GitHub closer to what I want it to do. To fit constraints of size and file number I've compressed all the third-party programs into a .zip file which needs unpacking and putting in the right place, as described in the README. I've also left the demos out of the package so it just has the "Peach for wizards" manual/demos.

Please let me know if it compiles for you or if there's anything missing when you try to do it.

Chronos

  • Full Member
  • ***
  • Posts: 240
    • PascalClassLibrary
Re: Peach: Homebrew your own Duolingo
« Reply #8 on: December 17, 2021, 07:25:30 pm »
Nice, I was able to compile and run your project successfully on Windows.
I guess it is both challenging and enjoyable to learn new things working on your own project. You are the author and you decide how it should look like. We can only give you some useful hints and suggestions for improvements.

  • The thing with two Peach projects is pretty misleading and unnecessary creates another depth in directory structure. It would be better to have those projects either side by side in different directories (like Peach and Peach launcher) or to have them in the same directory and rename launcher project files to different name like startpeach or Peach-launcher. Also Peach launcher doesn't have project files visible in Project inspector.
  • I would recommend you to create Packages subdirectory in your project and put there source code of all used Lazarus Packages. Then also in Project inspector you can set those dependencies by right click by mouse through context menu as "Preferred". Thanks to this anybody downloading your project will be able to compile it including dependencies right away without manually downloading those dependencies. richmemo can be downloaded manually or from online package manager, but source of online package can change in time or maybe not available in future so it is always good idea to preserve all used packages source locally in your project to avoid possible problems in future and easy first time compilation.
  • Your packages WordMemo and PythonPackage are located in the same place as project and use some units which they even don't have in Package files tree. Packages should be self-contained and independent of project. Put them into Packages/WordMemo and Packages/PythonPackage subdirectories and move there also all required files for packages compilation. I've created a new package PeachPackage there to move needed files there so WordMemo and PythonPackage can be compiled independently. Also without this it was not possible to Install those packages into Lazarus as Lazarus was reporting error with changing checksums of some libs. With everything cleanly separated all packages were installed successfully.
  • Please activate High DPI support in Project options dialog Project Options - Application - For Windows - DPI awareness to on (True). Then you need to recompile application. In case of normal (100%) DPI you won't see the difference, but you can change DPI in windows to 125%, 150% or even 200% to see ho it scales. I use 150% and main window looks ok but some dialogs have incorrect proportions. At least text looks sharper with DPI activated than without DPI support.
  • How can be the application fully tested without username and password? Is there some demo username and password available or can it be tested without connection to server?
  • Please use JEDI Code Format (Ctrl+D) accessible from Lazarus main menu Source to format your source code in more readable form. You are not doing proper indentation after begin keyword. I prefer Delphi VCL coding style but you can adjust JEDI Format settings to get different result if you like.
  • Add Debug and Release build modes in Project settings. Usually Release mode has highest optimizations enabled (O2 or O3) and disabled all runtime checks to get faster build times and disabled debugging. And Debug build mode has all checks enabled, debugging enabled and only O1 optimizations. In Debug mode you should also activate Use heaptrc unit in Debug section to get report about memory leaks after app termination. https://wiki.freepascal.org/heaptrc
  • git supports a file called .gitignore where you can put names of dynamically created directories and files which should be ignored by git and not put into repository.

You can see some of those suggested changes in forked repo https://github.com/chronoscz/source

Also you should give Peach repo some better name like "Peach" or "peach" or "peach-app" for example so the name of forked repos will make more sense :)

Spoonhorse

  • Full Member
  • ***
  • Posts: 123
Re: Peach: Homebrew your own Duolingo
« Reply #9 on: December 19, 2021, 04:39:06 pm »
Chronos, thanks for the code review. I'll get on that over the next few days. (My "weekend" is only just starting.)

I also have a user asking for bold, italic, etc. I did it with WYSIWYG but it was terribly slow turning the rich text in the editor into a .vcb file so for now I'm going to do it with markup.

Spoonhorse

  • Full Member
  • ***
  • Posts: 123
Re: Peach: Homebrew your own Duolingo
« Reply #10 on: December 19, 2021, 10:49:34 pm »
BTW I've done the markup things requested by the user so if you restart Peach it should update.

Spoonhorse

  • Full Member
  • ***
  • Posts: 123
Re: Peach: Homebrew your own Duolingo
« Reply #11 on: December 22, 2021, 03:56:31 pm »
P.S.

(1) I don't understand what you mean about debug and release modes. It seems like you're telling me to do two opposite things? Do I do them in different places?

(2) About internet access, you can Register at the top of the Classroom menu.

Chronos

  • Full Member
  • ***
  • Posts: 240
    • PascalClassLibrary
Re: Peach: Homebrew your own Duolingo
« Reply #12 on: December 22, 2021, 06:37:56 pm »
You get more information about build modes here https://wiki.lazarus.freepascal.org/IDE_Window:_Project_Options#Build_modes
In general you may want two basic build modes: Debug and Release.

Then build mode can be also specified on command line as:
lazbuild --build-mode=Release Peach.lpi

This can be later usable for releasing Windows/Linux/Mac binary packages.

Spoonhorse

  • Full Member
  • ***
  • Posts: 123
Re: Peach: Homebrew your own Duolingo
« Reply #13 on: December 23, 2021, 07:34:52 pm »
So, questions. I think I did something wrong. I was trying to follow what you'd done, I got the packages set up and did the stuff with the package manager and dependency manager and it shows that the packages are attached to the project, but then it complained that it couldn't find PyMemo in the uses section of Main. Now, I can totally fix that by adding PyMemo to the project. But is that what I'm meant to do, or is that just circumventing the fact that I haven't got the packages working properly?

Thanks. Sorry, I've never done anything approaching this complexity before. My employers (Huge Tech Company You've Definitely Heard Of) are going to start training me to be a developer starting Jan 31, but for now I'm sort of ... a barefoot yokel.

Chronos

  • Full Member
  • ***
  • Posts: 240
    • PascalClassLibrary
Re: Peach: Homebrew your own Duolingo
« Reply #14 on: December 23, 2021, 10:06:52 pm »
Yes, you need to play with that for a while to find out how to use it. Basically those packages need to be able to compile itself. You can verify individual packages if they compile correctly by clicking on their Compile button. If PythonPackage compiles correctly and it contains pymemo file, then if main project has PythonPackage as dependency and compilers knows where that package is, then it should be compiled and unit should be found as expected.

There can be also some problems if you already had pymemo file in your project before. Then it was compiled into lib directory. Then if you move that file to the package, then you should better delete that lib directory so compiler is not confused with that old object file.

There are also some informative wiki pages like https://wiki.freepascal.org/Lazarus_Packages

And you can also compare files in my fork with your git to see the differences. Or you can open my modified .lpi project and simply hit Ctrl+F9 to build it. It should build without any additional steps. Then you can also examine how packages are set as dependencies and which files they contain.

 

TinyPortal © 2005-2018