Skip to content

Conversation

@skulidropek
Copy link
Contributor

@skulidropek skulidropek commented Nov 7, 2025

#117
The win32$φ atom now properly detects the Windows platform by returning the result of `process.platform === 'win32'`, replacing the previous unimplemented stub that threw an error.

The win32$φ atom now properly detects the Windows platform by returning
the result of \`process.platform === 'win32'\`, replacing the previous
unimplemented stub that threw an error.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skulidropek this is incorrect logic for the atom. Here you can find how this atom must be implemented: https://github.com/objectionary/eo/blob/master/eo-runtime/src/main/java/EOorg/EOeolang/EOsm/EOwin32%24EO%CF%86.java

skulidropek and others added 3 commits November 11, 2025 18:22
- Refactor win32.js dispatcher to route function calls
- Create 17 separate modules in win32/ folder:
  - 6 fully implemented: GetCurrentProcessId, ReadFile, WriteFile,
    GetEnvironmentVariable, GetSystemTime, inet_addr
  - 11 stubs for socket/WSA operations
- Add EO test suite (win32-test.eo) with 5 test cases matching Java reference

All 180 runtime tests pass. Implementation matches Java version.
Fix ESLint arrow-parens rule violation in win32/inet_addr.js
@skulidropek
Copy link
Contributor Author

skulidropek commented Nov 14, 2025

@maxonfjvipon
Can you tell me how I can properly set up a Windows test environment?
So that my tests run on Windows github Worker?

This will help me complete all tasks faster.

@maxonfjvipon
Copy link
Member

@skulidropek if you don't have windows pc, we have windows CI on GHA, you just need to write a test and make it test runnable only if current platform is windows

Copy link
Member

@maxonfjvipon maxonfjvipon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skulidropek in general PR is good, but it's quite big and complex, so it'll be not easy to review to carefully. Please try to make a smaller PRs in the future.

Also it would be better to introduce some syntetic js tests for a several syscalls, check this: https://github.com/objectionary/eo/blob/master/eo-runtime/src/test/java/EOorg/EOeolang/EOsm/EOwin32Test.java

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skulidropek let's move this function out of win32$φ

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skulidropek let's make a single 'interface' for each function so you can just do func(rho, args) for all functions

'GetEnvironmentVariable requires 1 argument (variable name)'
)
}
const varName = getArg(0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skulidropek we're trying not to use complex variable names, read this: https://www.yegor256.com/2015/01/12/compound-name-is-code-smell.html

Go though all variable and function arguments and fix this

second: now.getSeconds(),
milliseconds: now.getMilliseconds(),
}
return data.toObject(JSON.stringify(result))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skulidropek that's not gonna work because you'll get JSON which will be converted to string, please learn more carefully how this object is supposed to work

}
const filePath = getArg(0)
try {
const content = fs.readFileSync(String(filePath), 'utf8')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skulidropek this implementation has very high level of abstraction because fs.readFileSync is platform independ and you don't use file descriptor which is the first argument. Please learn implementation of EOorg.EOeolang.EOsm.Win32.ReadFileFuncCall.java more carefully

)
}
const ipString = getArg(0)
// Validate IP address format (simplified IPv4 validation)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skulidropek we're trying not to used comment inside function body. Instead, move all the necessary documentation to the function js-doc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skulidropek this comment is unnecessary

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skulidropek we're trying not to use empty lines in function body, read this: https://www.yegor256.com/2014/11/03/empty-line-code-smell.html

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skulidropek let's move this object out of win32$φ function

@@ -0,0 +1,45 @@
# SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skulidropek not a good place for such tests. Please check eo2js/test/it/runtime-tests.test.js. Here you can find excluded sys/win32-tests. Remove them for the exclude list and make sure they pass

@skulidropek skulidropek marked this pull request as draft November 20, 2025 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants