<kenaan>
arigo cffi/cffi 28290fb948f1 /testing/cffi1/test_new_ffi_1.py: no-op, but avoids confusion because these two are always listed in the opposite order elsewhere
<lesshaste>
ronan, so this means I need to install jupyter using the pypy version of pip?
<ronan>
yes
<lesshaste>
in case I wasn't clear (or am just confused) I am only want my python code to be run in pypy. I don't even know if jupyter is written in python of course
<lesshaste>
I think this is what they call using pypy as a kernel?
vkirilichev has quit [Remote host closed the connection]
<ronan>
yes, jupyter is written in python. It might be possible to run a pypy kernel on top of a CPython jupyter or vice versa, but I've never found out how
<lesshaste>
ah ok
<lesshaste>
I think that's what I want to do
vkirilichev has joined #pypy
vkirilichev has quit [Read error: Connection reset by peer]
vkirilic_ has joined #pypy
trfl has joined #pypy
ramonvg has joined #pypy
<mattip>
lesshaste: you could add it as an additional kernel, like getting jupyter to run either python2 or python3
<mattip>
it seems the idea is to setup jupyter, then, in a pypy env, pip install ipykernel
<mattip>
then somehow register that with your jupyter. It would be nice if you could document your steps to success
<lesshaste>
thanks :)
<mattip>
and we could get them into the official documentation somehow
<lesshaste>
pypy doesn't talk about windows a whole lot
<lesshaste>
in the docs I mean
<lesshaste>
mattip, there is still no 64 bit pypy for windows which always surprises
<lesshaste>
me
<mattip>
ye$, there i$ a way thi$ could be $olved, if the $omething like the Mozilla grant to move PyPy3.5 forward would happen
<bremner>
itym y€s th€r€ is ... ;)
<danchr>
isn't pypy3 in reasonably good shape?
<cfbolz>
danchr: yes, but win64 isn't
<danchr>
ah, I missed the “something like” part :)
lesshaste has quit [Read error: Connection reset by peer]
<mattip>
can someone remind me what is the state of OS X and py3.5?
<mattip>
right now translation fails, is that because the buildbot is too old?
<danchr>
mattip: I use it on a day-to-day basis
<danchr>
but yeah, the buildbot fails due to unrelated issues
<danchr>
mainly the fact that it uses the bundled OpenSSL on an old version of OS X — which newer versions still include the library for, but not headers
<mattip>
danchr: cool, I am starting to prep the 5.8 release, and it would be nice to release a OS X py3.5 tarball
<mattip>
binary
<mattip>
could we impose on you to either upload it once I tag a version?
<mattip>
or run a buildbot :)
<danchr>
mattip: the main issue is where/how to get OpenSSL libraries
marky1991 has quit [Ping timeout: 255 seconds]
<danchr>
I build against MacPorts, and I have a pypy3 port waiting to be committed, but the binaries I use aren't stand-alone as such
<mattip>
what does cpython do?
<danchr>
Apple distributes CPython 2.7; no idea whether the PSF distributes py3k binaries
<danchr>
seems like a linuxism; it's not available on FreeBSD either AFAICT
<mattip>
so that should be only used conditionally on it existing
<arigato>
mattip: I accepted a pull request to add that; I guess the PR author didn't check
<arigato>
note that rposix.SCHED_BATCH is always defined (on posix), but may be None
* mattip
grepping for examples of conditional definitions
<danchr>
AFAICT both OS X and FreeBSD only define SCHED_FIFO, SCHED_OTHER and SCHED_RR, but not SCHED_BATCH
<danchr>
wouldn't it be possible to fix this is in the rpython logic so that it automatically checked for any predefined symbols?
<danchr>
last time the branch broke it was exactly the same kind of error…
<mattip>
there is rffi_platform.Has() but it is for functions
<danchr>
right; I was wrong — the cause of the error is the bare assert, of course
marky1991 has joined #pypy
<mattip>
arigato: the docstring of DefinedConstantInteger would suggest it is doing exactly what you requested
<arigato>
what did I request?
<mattip>
"rposix.SCHED_BATCH is always defined (on posix), but may be None"
<arigato>
it was not a request
<mattip>
and in rposix there is SCHED_BATCH = rffi_platform.DefinedConstantInteger('SCHED_BATCH')
<arigato>
I was describing how it works right now
<arigato>
the code in pypy/module/posix/__init__.py needs fixing, to not crash when SCHED_BATCH is None, but instead to not expose anything to app-level
dcrosta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mattip>
ronan: around? it seems py3.5 need a merge from default before the release, and there are conflicts
<sms>
I know how I could use the library if I need if I #import it and write some Python functions to use, but I was just wondering if there's a way to just #import an entire library into C to use the functionality.
<sms>
Exposing a library written in Python directly to C/C++ programs.
<sms>
How
q4 has joined #pypy
<mattip>
sms: that page is state-of-the-art best practice, especially on this IRC channel
<ronan>
mattip: I'll do it
<mattip>
ronan: thanks.
<tos9>
If I have a dict with static keys and then do millions of lookups into it, how good is the JIT these days at figuring out that it can actually turn that into array lookups amd ot
<tos9>
s/amd ot//
<tos9>
Or do I still need to wrap that into an instance of a class to convince it to
<tos9>
Or use pypy.whateverdictthingIrememberisInthere
<dash>
sms: python is fast, C is slow
<dash>
sms: what do you need C for, exactly?
<sms>
I don't agree with that
<sms>
It's faster to write functioning code with yeah
<dash>
sms: probably because you have not used pypy enough ;-)
<sms>
But the main reason is because I'm creating a music streaming application
<dash>
ok. in the style of icecast, etc?
<sms>
More like Spotify
marky1991 has quit [Read error: Connection reset by peer]
<dash>
ok. pypy would probably be a good choice for this
<sms>
How portable is PyPy
<dash>
it runs on x86, arm, ppc
<dash>
and s390 but i think mainframers only listen to vinyl
<sms>
Yeah the reason I want to use C though dash is so I don't have to have a Python environment installed and setup on Windows just to use my program
<dash>
sms: sure, but there are several tools that help with that these days
<sms>
Like what?
<ronan>
tos9: I don't think you can turn dict loookups into array lookups. OTOH class instances are fast and tend to make your code look better.
<dash>
sms: or to rephrase: if you want to embed python in a c program, you will have to solve this problem anyway
<dash>
sms: so it's easier to just figure out your windows distribution strategy and write stuff in python instead :)
<tos9>
ronan: If you have a static set of keys that never changes, just make believe it's a struct
<tos9>
ronan: Same as if it was a class whose __dict__ was those things
<sms>
That's not true, CFFI creates a standalone library independent of Python
<tos9>
ronan: And yeah I can turn it into a class it just actually makes things a bit uglier here because someone says "I want a, b, and c", I make {a: foo, b: foo, c: foo} and then hand back a function that basically is call("a") -> d["a"].bla(1, 2, 3), so external users don't see the dict/instance
<tos9>
it's just inside a closure
<dash>
sms: if you're going to run python code, you have to have a python runtime.
<sms>
Wait you're right I guess, I misread
<ronan>
tos9: I see what you mean , but classes will give you the best perf for that use case in pypy
<sms>
Alright that's really annoying
<sms>
Hmm
<tos9>
ronan: /nod -- sounds good, jsut figured I'd check to see if anything'd changed :), thanks1
<tos9>
!
<ronan>
tos9: I'd just write some make_struct() function create the classes and hide the metaprogramming from the rest of the code
<tos9>
Yeah, gonna just use `type` or attr.make_class I think.
<dash>
sms: python annoyed me so much i started making my own programming language instead
<dash>
(... using pypy's tools for it :)
<sms>
It's not that I don't like Python, it's just that I don't use much aside from Python
<sms>
So I wanted to make some cool portable app
<sms>
But then I needed to write something that would be a huge pain to do in native C but trivial in Python, but there goes portability I suppose
<dash>
it's not like portability is easy in C either
<nimaje>
sms: well, how about using one of those single binary creators for windows, and other platforms most likely have a good package manager?
<sms>
I mean, it's not a huge deal for me. I can set up my environments
<sms>
But let's say I wanted to put it up on a website for other people to use, I don't want a huge instruction manual on how to use it
<sms>
Having people set up their environment just to use a music streamer
<ronan>
sms: with things like py2exe or cx_Freeze, most users won't even know that the app uses Python
<sms>
Hmm
<nimaje>
sms: and why would that setup for a program writen in C be easier? with python they can run it after installing the dependencies, with C they also have to compile it (ok most times not really difficult, but one step more)
vkirilic_ has quit [Remote host closed the connection]
<kenaan>
mattip default 72697b76c5bf /pypy/doc/release-v5.8.0.rst: summarize changes since 5.7.0, read up to changeset 77bf5cbc29e9
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<sms>
What you guys don't realize is
<sms>
I've wrote Python almost exclusively for a LONG time
<sms>
I'm sick of using it and want to get better at other languages
<dash>
sms: good idea
<sms>
Also I don't know how it's being argued that C isn't any more portable
<sms>
Are you forgetting that Python is interpreted
<dash>
sms: on pypy it's compiled to native code :)
<dash>
sms: point is, you are used to distributing python programs as source code
<sms>
Yeah pretty much
<dash>
sms: you can build an installable standalone windows program from python code
<sms>
Maybe I'll do that after, if I can't get this working in C
<dash>
sms: that's just as portable as one built from C code
<sms>
Yeah I need to look into that more
<sms>
It's fast to?
marr has quit [Ping timeout: 240 seconds]
mat^2 has joined #pypy
ramonvg has quit [Remote host closed the connection]
tbodt has joined #pypy
adeohluwa has quit [Quit: Connection closed for inactivity]
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]