scalachess
CPython
scalachess | CPython | |
---|---|---|
15 | 1,533 | |
734 | 68,533 | |
1.2% | 1.2% | |
9.8 | 10.0 | |
6 days ago | 6 days ago | |
Scala | Python | |
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
scalachess
- What happens when you make a move in lichess.org?
-
Post-Mortem of Our Longest Downtime
I worked with him once on a job -- incredibly nice guy and obviously talented developer who used to work for the French agency responsible for the Scala Play Framework. https://github.com/lichess-org/lila and https://github.com/lichess-org/scalachess are great resources for anyone ever curious to see a production quality Scala3 web application using Cats and all the properly functional properties of the language.
-
The rarest move in chess [video]
Great investigation and excellent production value!
Brings back good memories too, as 10 years ago my first contribution to lichess was to improve the PGN notation for disambiguation. [1]
[1] https://github.com/lichess-org/scalachess/blame/master/core/...
-
Lichess potentially allowed promotion of pawns to king
Well, only since this year, it seems.
-
The reason why you need good, thorough tests when writing chess engines
From another reddit thread I got the link to the commit with the fix. Thankfully, they did add a test case for this: https://github.com/lichess-org/scalachess/commit/f5218340b2a229fa519ecd239fe50aee722bcd0f
-
lichess doesn't let me capture en passant in the game, only in the analysis board
To be fair, that TODO has only been there for three weeks, which seems reasonable, especially considering it was written by a volunteer.
- Why does nobody play Capablanca chess anymore, while Fisher random is quite popular?
-
White to move. This position is a win in lichess, draw in chess.com.
Lichess does not check for mate. It simply doesn't consider KBvKN a drawn endgame.
- Where can I find lines to test my new music-memory technique?
-
Ask HN: Codebases with great, easy to read code?
https://github.com/lichess-org/scalachess/tree/master/src/ma...
It's funny because I remember comparing it to mine that I had tried to write during college, and appreciating how much better it is.
Pay attention to how there's a bunch of different types of chess in there too, and how that's factored.
CPython
-
What is the GIL in Python and Why Should You Care?
import requests import time import threading # List of URLs to download (example sites) urls = [ "https://www.example.com", "https://www.python.org", "https://httpbin.org/delay/2", # artificial delay "https://www.github.com", "https://www.wikipedia.org", ] # Function to download content from a URL def download_url(url): print(f"Starting download: {url}") response = requests.get(url) print(f"Finished downloading {url} (size={len(response.text)} characters)") # Run sequentially (one after another) def run_sequential(): start = time.time() for url in urls: download_url(url) end = time.time() print(f"\nSequential time: {end - start:.2f} seconds\n") # Run with threads (concurrently) def run_with_threads(): start = time.time() threads = [] for url in urls: thread = threading.Thread(target=download_url, args=(url,)) threads.append(thread) thread.start() # Wait for all threads to finish for thread in threads: thread.join() end = time.time() print(f"\nThreaded time: {end - start:.2f} seconds\n") # Run the two scenarios if __name__ == "__main__": print("=== Sequential ===") run_sequential() print("=== With Threads ===") run_with_threads()
-
Python: The Documentary
Also, you say "temporary variable" but it's no more temporary than any other local variable, because lexical scoping is evidently for children
I have always hated that comprehension variables leak for that same reason
1: https://github.com/python/cpython/blob/v3.13.7/Grammar/pytho...
-
Trackable Flask API using EventSource
Python, the programming language used in Flask. This tutorial is meant for version 3 or later.
-
Getting Started with Loops and Standard Inputs in Python
Python installed on your computer.
-
Your 2025 Roadmap to Becoming an AI Engineer for Free for Vue.js Developers
AI starts with math and coding. You don’t need a PhD—just high school math like algebra and some geometry. Linear algebra (think matrices) and calculus (like slopes) help understand how AI models work. Python is the main language for AI, thanks to tools like TensorFlow and NumPy. If you know JavaScript from Vue.js, Python’s syntax is straightforward.
-
A Python dict that can report which keys you did not use
It's unreasonable to ask me to chase down a reference in a book but I did it anyway because I was really curious.
It doesn't support what you said on your previous comment. It was a bit of a word salad but seemed to suggest that any calls to your overridden methods might magically use the base class instead, even when director called from application code. But the book says something very different:
> The code of the built-ins (written in C) usually does not call methods overridden by user-defined classes.
But that is nothing to do with built in classes or even being written in C. Any class, even written in pure Python, is not guaranteed to implement any of its method in terms of other public methods, even when it's possible to do that. It just depends on how it's implemented.
Indeed that's true even for UserDict. It's no longer implemented in pure Python, but if you look at the 2.7 version [1], which was, you can see some methods implemented in terms of others (e.g. get() uses `key not in self` and `self[key]`) and others that aren't (e.g. keys() just uses self.dict.keys() rather than being implemented in terms of self.items()).
There was even a breaking change in Python 3.12 to which other methods UerDict.__getitem__() uses in its implementation [2]. So it really makes no difference: either way, you'll have to override all methods that you want to behave differently (and use).
[1] https://github.com/enthought/Python-2.7.3/blob/master/Lib/Us...
[2] https://github.com/python/cpython/issues/105524
-
Never write your own Date Parsing Library
I requested an ISO 8601 date parser in the Python "datetime" library in 2012.[1] "datetime" could format into ISO 8601, but not parse strings. There were five ISO 8601 parsers available, all bad. After six years of bikeshedding, it was was fixed in 2018.
That's what it took to not write my own date parsing library.
[1] https://github.com/python/cpython/issues/60077
-
Building a Complete Social Media Backend with Django - Part 2: Development Environment Setup
Install Python3.11 from python.org
-
Checking Out CPython 3.14's remote debugging protocol
https://rr-project.org/ is a great Time-Travel debugger and has the capability to record and replay the execution of the CPython interpreter, but since it depends on GDB (which just knows how to inspect compiled programs) it struggles to present the state of the Python program running inside of the interpreter.
I've found that the best way to inspect Python programs with GDB is to use the GDB extensions (https://github.com/python/cpython/blob/3.13/Tools/gdb/libpyt...) that the CPython project maintains. It's a bunch of code that tells GDB how to navigate the interpreter internals and how to find things like the local variables and the backtrace of the currently executing function. You can actually see quite a lot using this! It falls short if you need to do any kind of navigation or stepping, but it's great for understanding what your program is doing "right now".
At my employer https://undo.io we makes a Time-Travel debugger called UDB which is similar to rr and we've had some success introducing time-travel into this Python debugging approach. We can record and replay Python processes, and with some additions on top of the GDB extensions from CPython we can navigate around the execution history. It's a bit rough around the edges, but it's really powerful to be able to evaluate Python expressions at arbitrary points in time, and we're finding it valuable to use internally. Here are some more details if you're interested (you should be able to adapt this to rr): https://undo.io/resources/how-i-debug-python-code-with-a-tim....
I expect that this new remote debugging protocol will be useful to some of the approaches we're currently testing out.
-
Setting up a multi-factor dev environment for payment approvals
Working knowledge of a backend language like Node.js or Python
What are some alternatives?
Stockfish - A free and strong UCI chess engine
RustPython - A Python Interpreter written in Rust
lila - ♞ lichess.org: the forever free, adless and open source chess server ♞
git - A fork of Git containing Windows-specific patches.
ramda - :ram: Practical functional Javascript
ipython - Official repository for IPython itself. Other repos in the IPython organization contain things like the website, documentation builds, etc.